Unbound SERVFAIL with no EDE: lame delegation or REFUSED upstream
Unbound SERVFAIL with no EDE doesn't name the cause. Here (ede: yes) the delegated NS said REFUSED. Compare with +cd, then query the NS listed at the parent.
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 43158;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232;; QUESTION SECTION:;www.refused.test. IN AA SERVFAIL with no EDE: line in the OPT PSEUDOSECTION. Unbound 1.19.2 (ede: yes) sent the response above when the name server delegated for refused.test answered REFUSED. In this test a delegation problem showed up as a SERVFAIL without EDE, but a missing EDE is not enough to name the cause. RFC 8914 defines EDE as optional extra information that can also be dropped to fit the size limit, so nothing guarantees every error carries a code. Query again with +cd to rule DNSSEC in or out, then look up the NS records at the parent zone and query that server directly to tell the cases apart. When the authoritative server could not be reached at all, not even a SERVFAIL came back ([4]).
To decode a full dig output (status, flags, EDE), paste it into the dig output explainer.
[1] Confirm the resolver sends EDE at all. Unbound adds EDE only with ede: yes, and the manual lists the default as no. With it off, every SERVFAIL lacks an EDE line and this clue tells you nothing. On the same resolver (ede: yes), a zone with a broken signature looked like this:
$ dig @127.0.0.3 www.broken.test…;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 50487…; EDE: 6 (DNSSEC Bogus): (validation failure <www.broken.test. A IN>: signature crypto failed from 127.0.0.2)EDE 6 to 10 means DNSSEC: go to dig status: SERVFAIL — split out DNSSEC with +cd. No EDE? Ask for the same name again with dig @<resolver> <name> +cd. If +cd returns data, it is DNSSEC: use the post above. If +cd still gets SERVFAIL, read on and check the delegation. (This test did not retry refused.test with +cd.)
[2] Ask the parent zone for the delegation. Query the parent's authoritative server with +norecurse; it returns the NS and its address (glue) without aa.
$ dig @127.0.0.2 www.refused.test +norecurse…;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 2…;; AUTHORITY SECTION:refused.test. 86400 IN NS ns.refused.test. ;; ADDITIONAL SECTION:ns.refused.test. 86400 IN A 127.0.0.4In this test the parent was the zone holding the delegation (127.0.0.2), not the test TLD. For a real domain registered directly under a TLD (like example.com), the parent is the TLD server. Under co.uk, or for a separately delegated subzone, the parent is the zone right above it. Either way, find the last referral in dig +trace <domain> that hands out the target zone's NS, then ask that parent's authoritative server with dig @<parent NS> <domain> NS +norecurse. For a registered domain, these names and addresses are what was entered at the registrar.
[3] Query that NS directly. Add +norecurse so a server that also does recursion can't answer from recursion instead. The captured query below had rd set:
$ dig @127.0.0.4 www.refused.test…;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 33822;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 1232; COOKIE: cf0960bedd770f2d010000006ae088ae8c05ac60d6203392 (good);; QUESTION SECTION:;www.refused.test. IN AIn this test the server the delegation points at (127.0.0.4) did not have the zone: a lame delegation. REFUSED (RCODE 5), though, means the server refused for policy reasons, and a missing zone is only one of them; as the note below shows, allow-query also produces REFUSED. Don't create a zone or change NS records on a REFUSED alone. Check on that server first, through its config, logs or provider dashboard:
- Is the zone defined, and did it load without errors?
- Does an access policy such as
allow-queryblock the querying address (the resolver's outgoing address)?
If the zone really is missing, fix one side:
- Create the zone on that server (or at that DNS provider). Typical after moving providers before the zone exists at the new one.
- Change the NS list at the registrar to servers that actually hold the zone. Typical when the old provider's NS is still listed. Write down the current NS list first so you can roll back. Resolvers may keep the old delegation until the cached NS TTL runs out (86400 seconds in this test's parent answer).
With several NS records, query each one. This test used a single-NS delegation.
[4] Separate the "can't reach the NS" case. With the NS for lame.test set to an address where nothing listens, Unbound did not answer for 60 seconds:
$ dig @127.0.0.3 www.lame.test +tries=1 +timeout=60;; communications error to 127.0.0.3#53: timed out ; <<>> DiG 9.18.39-0ubuntu0.24.04.8-Ubuntu <<>> @127.0.0.3 www.lame.test +tries=1 +timeout=60; (1 server found);; global options: +cmd;; no servers could be reached127.0.0.3 is the resolver, so this reads like "the resolver is down". Ask the same resolver for another name:
$ dig @127.0.0.3 www.acl.test…;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15860…www.acl.test. 3600 IN A 192.0.2.50If other names resolve, the resolver is fine: find the delegation as in [2] and query that NS. An address with no listener was refused right away (this capture asked for www.lab.test, but the name doesn't matter for a reachability check):
$ dig @127.0.0.9 www.lab.test +tries=1 +timeout=1;; communications error to 127.0.0.9#53: connection refused…;; no servers could be reachedWhen packets are dropped on the way, you get timed out instead of connection refused; that is what happened from an address hit by Unbound's access-control: deny (drop without reply). The dig manual lists "No reply from server" as exit code 9. How this looks on the client side is covered in Temporary failure in name resolution.
The table lists the pairs seen in this test (Unbound 1.19.2, ede: yes). For rows without EDE, don't settle the cause from the table; confirm it with the direct query in the middle column.
| From the resolver | Directly at the NS | Case |
|---|---|---|
SERVFAIL + EDE: 6–10 | — | DNSSEC validation failure |
SERVFAIL, no EDE, still SERVFAIL with +cd | REFUSED | Delegated server refuses: check zone presence and access policy — [3] |
No reply (timed out) | timed out or connection refused | NS unreachable: address, firewall — [4] |
REFUSED + EDE: 18 | — | Resolver blocks this client — dig status: REFUSED |
[5] What a resolver does with +norecurse depends on its configuration. On this test's Unbound, a query for a cached name from an address with access-control: allow got REFUSED. That is an access-control result unrelated to the delegation, so don't mix it up with the REFUSED in [3]:
$ dig @127.0.0.3 www.lab.test +norecurse…;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 51974;; flags: qr ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1…; EDE: 20 (Not Authoritative)The Unbound manual says allow lets nonrecursive queries reach configured local-data but refuses replies from the dynamic cache. The same query from an address opened with allow_snoop returned the cached answer (TTL 3534 remaining). On Unbound, the "use +norecurse to peek at the resolver cache" trick needs that setting; for other resolvers, check their own manual.
Sources: RFC 8914 · RFC 1035 §4.1.1 (RCODE 5 Refused) · Unbound unbound.conf (ede, access-control) · BIND 9.18 dig manual
Check it with the dig output explainer tool ↗ — calculated in your browser.