Skip to main content
These commands match DNS → Forwarding in the dashboard. They need a superadmin. For how forwarding, strategies and rules work, see Forwarding.

Upstreams and strategy

dnz fwd is a short alias for dnz forwarding. Upstreams can be plain DNS (1.1.1.1, 9.9.9.9:53), DNS over TLS (tls://dns.quad9.net), DNS over HTTPS (https://dns.google/dns-query), DNS over QUIC (quic://dns.adguard-dns.com) or DoH over HTTP/3 (h3://cloudflare-dns.com/dns-query). See Forwarding for the full address format. The strategies are failover, wrr, p2c, hrw and least_time. Changing it takes effect without a restart.

Recursive resolution

Instead of forwarding, DNZ can resolve names itself from the root servers, like Unbound. See Recursive resolution.
dnz forwarding show says when the mode is recursive; the upstream list is kept for switching back. trace works whatever the mode. A rule resolves recursively with recursive as its upstreams:

DNSSEC validation

See DNSSEC validation.

Conditional forwarding rules

Rules send a domain and its subdomains, or every name some clients ask for, to other resolvers.

Rules for client networks

* as the domain needs --network.

Rule options

How rules are matched

  • Rules are found by id, label or domain.
  • They are checked in order (the # column of dnz forwarding rule list) and the first match wins.
  • A new rule goes above the first less specific rule (a shorter domain, or a wider network), unless you pass --position.
  • A rule that an earlier rule always catches first is marked never matches in the list.

Diagnosing an upstream

dnz forwarding diagnose <address> (alias diag) checks any upstream, configured or not, step by step from the server. It prints each step as it finishes:
  1. name lookup (DoT and DoH)
  2. local route
  3. ping
  4. the TCP port
  5. the TLS handshake
  6. a DNS query over the upstream’s protocol (and over TCP for plain DNS)
  7. a check for port 53 interception
  8. a traceroute
Failed or suspicious steps come with a hint at the likely cause.
--name and --type choose the query (default example.com A). The dashboard has the same check behind the Diagnose button on every upstream and rule.

Serve-stale, prefetch and client subnet

  • --window takes 90s, 30m, 12h, 1d and so on, up to 7d.
  • --min-hits is how often a name must be asked since it was cached to be refreshed in the last tenth of its TTL.
  • dnz forwarding show lists these options under the rules.
See Resolver options.