English
DNS
Ours: the syntax — modules/dns/dns/src/syntax.rs, the servers — modules/dns/dns/src/transport*, local.rs, hosts.rs, mdns.rs, fakeip.rs; the query router — router.rs; the conditions of DNS rules are compiled by modules/routing/router/src/dns.rs. The reference: dns/*, option/dns.go, option/rule_dns.go of sing-box v1.14.4.
Servers
| What | Status | Where | Verdict |
|---|---|---|---|
dhcp | no: YAML has no such kind; at run time — DNS server type `dhcp` is not supported (deferred) | modules/dns/dns/src/transport.rs | missing |
resolved (systemd-resolved) and the resolved service | no | — | rarely needed: on desktop Linux |
tailscale, openconnect, openvpn | no | — | rarely needed: together with the endpoints |
local.prefer_go | silent: a warning | modules/dns/dns/src/syntax.rs | junk: in the reference it chooses the Go resolver over cgo |
local with systemd-resolved | different: always /etc/resolv.conf and /etc/hosts, like the reference without resolved | modules/dns/dns/src/local.rs | rarely needed |
h3: the request's fields | different: :method, :scheme, :authority, :path, the headers, content-type, accept, but every field is a literal with a literal name, where quic-go refers to QPACK's static table; quic-go also sends content-length, accept-encoding: gzip and user-agent | the same place | rarely needed: the field section is under QUIC's encryption |
h3: GOAWAY | different: the server's GOAWAY is read and ignored; the next query takes a new connection once the server closes this one. quic-go opens no stream past GOAWAY | the same place | rarely needed: a server closes the connection after GOAWAY |
Actions
The router can do all of the reference's actions (route, route-options, reject, predefined, evaluate, respond) and the race mode (router.rs), but YAML expresses only part of them:
| What | Status | Where | Verdict |
|---|---|---|---|
predefined (an answer from the configuration: rcode, answer, ns, extra) | no: not in YAML | modules/dns/dns/src/syntax.rs (dns_rule) | missing: to: {answer: …}; partly replaced by a hosts upstream |
evaluate + respond, response conditions (match_response, ip_accept_any, response_rcode, response_answer/ns/extra) | no: not in YAML; match_response, response_* in match are a load error; ip_accept_any is accepted, but without evaluate it does not match | the same place (refuse_response_conditions); the schema hides them — modules/dns/dns/src/schema.rs (DNS_RESPONSE_CONDITIONS) | missing: a syntax for checking the answer; refuse ip_accept_any until then |
reject reply | no, as in the reference | modules/routing/router/src/dns.rs | — |
reject.no_drop | no: not in YAML | syntax.rs (reject) | rarely needed |
route to a fakeip server | different: the do: fakeip label | design | — |
route.speculative without race | silent: a warning at load time | modules/routing/router/src/dns.rs | — |
Conditions
| What | Status | Where | Verdict |
|---|---|---|---|
The same platform-specific and unimplemented ones as in route (wifi_*, clash_mode, *_interface_address, preferred_by, …) | no | modules/routing/router/src/dns.rs (unsupported) | see routing.md |
outbound | different: in the reference deprecated since 1.12 and removed in 1.14 (the OUTBOUND_ITEM message in router/src/dns.rs); ours — the main mechanism of outbound resolvers, with globs | modules/dns/dns/src/syntax.rs (resolver_prefix) | — (design) |
Address conditions without evaluate (ip_cidr, ip_is_private, rule_set_ip_cidr_accept_empty) | different: the reference's "legacy mode" — checking the chosen server's answer; accepted, with deprecation warnings | modules/dns/dns/src/router.rs, crates/dns-types/src/rules.rs | junk once evaluate appears in YAML |
strategy in the route action | present: deprecated in the reference (LEGACY_RULE_STRATEGY) | crates/dns-types/src/rules.rs | — |
Client and cache
| What | Status | Where | Verdict |
|---|---|---|---|
independent_cache | different: always true (deprecated in reference 1.14); the field is an error with an explanation | modules/dns/dns/src/syntax.rs | — |
cache_capacity below 1024 | present: raised to 1024, as in the reference | modules/dns/dns/src/client.rs | — |
store_rdrc | present: with a deprecation warning | modules/system/cache/src/enabled.rs | junk after removal in the reference |
| Cache storage | different: journals in a directory, not bbolt | modules/system/cache/src/enabled.rs | — (design) |
Beyond the reference
dns.listen (own listeners), bootstrap instead of a server's domain_resolver, the fakeip label with honest NXDOMAIN/NODATA, a live connection's fake address is not given to another domain (modules/dns/dns/src/fakeip.rs, Hold), PTR for pool addresses is answered from the table and does not go to the upstream (answer_ptr), labelled HTTPS/SVCB — without ipv4hint/ipv6hint (client.rs, without_address_hints), answers with real addresses under auto_nft (RealAnswers, crates/api/src/dns.rs).