Skip to content

DNS upstreams ​

dns.upstreams is a mapping "name → upstream". The kind of an upstream is the key, exactly one:

KeyWhat it isThe key's value
udpDNS over UDPthe server address, port 53 by default
tcpDNS over TCPan address, port 53
dotDNS over TLSan address, port 853
httpsDNS over HTTPSan address, port 443
quicDNS over QUICan address, port 853
h3DNS over HTTP/3an address, port 443
localThe system resolver: /etc/hosts, then the servers of /etc/resolv.confa settings block or empty
hostsAnswers from hosts files and a list in the configurationa settings block
mdnsMulticast DNS on the local networka 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: cloudflare

Fields next to the kind ​

FieldForMeaning
viaall network onesThe outbound or group the queries go through. Without it, directly
bootstrapthose given by nameWhat resolves the name of the server itself, see below
tlsdot, https, quic, h3TLS settings, the outbound tls block
dialnetwork onesSocket parameters, the dial block (interface, fwmark, connect_timeout, …)
skip_adblockalltrue 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: google
  • dns.bootstrap applies to all upstreams given by name; an upstream's own bootstrap field replaces it.
  • The value is the name of an upstream or an upstream: block with query parameters: strategy, timeout, cache (false or {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.

GPL-3.0-or-later