English
DNS upstreams
dns.upstreams is a mapping "name → upstream". The kind of an upstream is the key, exactly one:
| Key | What it is | The key's value |
|---|---|---|
udp | DNS over UDP | the server address, port 53 by default |
tcp | DNS over TCP | an address, port 53 |
dot | DNS over TLS | an address, port 853 |
https | DNS over HTTPS | an address, port 443 |
quic | DNS over QUIC | an address, port 853 |
h3 | DNS over HTTP/3 | an address, port 443 |
local | The system resolver: /etc/hosts, then the servers of /etc/resolv.conf | a settings block or empty |
hosts | Answers from hosts files and a list in the configuration | a settings block |
mdns | Multicast DNS on the local network | a settings block or empty |
An address is host or host:port: 1.1.1.1, [2606:4700:4700::1111]:53, dns.google. DNS over TLS is called dot because tls is the TLS settings block next to it.
yaml
dns:
upstreams:
router:
udp: 192.168.1.1
cloudflare:
https: 1.1.1.1
tls:
sni: cloudflare-dns.com
google:
dot: dns.google
bootstrap: router
system:
local:
lan-hosts:
hosts:
predefined:
nas.lan: [192.168.1.10]
printer.lan: 192.168.1.20
final:
upstream: cloudflareFields next to the kind
| Field | For | Meaning |
|---|---|---|
via | all network ones | The outbound or group the queries go through. Without it, directly |
bootstrap | those given by name | What resolves the name of the server itself, see below |
tls | dot, https, quic, h3 | TLS settings, the outbound tls block |
dial | network ones | Socket parameters, the dial block (interface, fwmark, connect_timeout, …) |
skip_adblock | all | true means adblock does not filter queries to it; the field exists only if the module is in the build |
path and headers are fields of https and h3; method is a field of https only.
via is how the query itself is delivered, not a setting of an outbound: an upstream with via: proxy asks the server through proxy.
bootstrap
An upstream given by name (https: dns.google) has to learn the address of its server somehow. The bootstrap upstream does this, directly, without dns.rules:
yaml
dns:
upstreams:
router:
udp: 192.168.1.1
google:
https: dns.google
adguard:
quic: dns.adguard-dns.com
bootstrap:
upstream: router
strategy: ipv4_only
bootstrap: router
final:
upstream: googledns.bootstrapapplies to all upstreams given by name; an upstream's ownbootstrapfield replaces it.- The value is the name of an upstream or an
upstream:block with query parameters:strategy,timeout,cache(falseor{optimistic: false}),rewrite_ttl,client_subnet. - The bootstrap upstream itself must be given by IP address or be
local: there are no chains or loops. - An upstream given by name without a bootstrap is a load error.
Unsupported kinds
dhcp, resolved, tailscale and other sing-box kinds are an error: only the ones listed above are allowed.