Skip to content

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 ​

WhatStatusWhereVerdict
dhcpno: YAML has no such kind; at run time — DNS server type `dhcp` is not supported (deferred)modules/dns/dns/src/transport.rsmissing
resolved (systemd-resolved) and the resolved serviceno—rarely needed: on desktop Linux
tailscale, openconnect, openvpnno—rarely needed: together with the endpoints
local.prefer_gosilent: a warningmodules/dns/dns/src/syntax.rsjunk: in the reference it chooses the Go resolver over cgo
local with systemd-resolveddifferent: always /etc/resolv.conf and /etc/hosts, like the reference without resolvedmodules/dns/dns/src/local.rsrarely needed
h3: the request's fieldsdifferent: :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-agentthe same placerarely needed: the field section is under QUIC's encryption
h3: GOAWAYdifferent: 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 GOAWAYthe same placerarely 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:

WhatStatusWhereVerdict
predefined (an answer from the configuration: rcode, answer, ns, extra)no: not in YAMLmodules/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 matchthe 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 replyno, as in the referencemodules/routing/router/src/dns.rs—
reject.no_dropno: not in YAMLsyntax.rs (reject)rarely needed
route to a fakeip serverdifferent: the do: fakeip labeldesign—
route.speculative without racesilent: a warning at load timemodules/routing/router/src/dns.rs—

Conditions ​

WhatStatusWhereVerdict
The same platform-specific and unimplemented ones as in route (wifi_*, clash_mode, *_interface_address, preferred_by, …)nomodules/routing/router/src/dns.rs (unsupported)see routing.md
outbounddifferent: 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 globsmodules/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 warningsmodules/dns/dns/src/router.rs, crates/dns-types/src/rules.rsjunk once evaluate appears in YAML
strategy in the route actionpresent: deprecated in the reference (LEGACY_RULE_STRATEGY)crates/dns-types/src/rules.rs—

Client and cache ​

WhatStatusWhereVerdict
independent_cachedifferent: always true (deprecated in reference 1.14); the field is an error with an explanationmodules/dns/dns/src/syntax.rs—
cache_capacity below 1024present: raised to 1024, as in the referencemodules/dns/dns/src/client.rs—
store_rdrcpresent: with a deprecation warningmodules/system/cache/src/enabled.rsjunk after removal in the reference
Cache storagedifferent: journals in a directory, not bboltmodules/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).

GPL-3.0-or-later