GrepBoard/Manuals
605 manuals ·

dig status: SERVFAIL? Use +cd to Check for a DNSSEC Failure

·Tested on Ubuntu 24.04 · BIND 9.18.39 dig/delv (Docker) · public resolvers 1.1.1.1, 8.8.8.8 · 2026-10·Test scope ↓·7 steps

When dig returns status: SERVFAIL, repeat the query with +cd. NOERROR means DNSSEC validation failed; read the EDE line and compare DS and DNSKEY key tags.

output
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 46809;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1…; EDE: 9 (DNSKEY Missing): (no SEP matching the DS found for dnssec-failed.org.)

status: SERVFAIL only says the resolver could not build an answer; it does not say why. Send the same query with +cd (checking disabled): if you get NOERROR and an address, DNSSEC validation failed; if it is still SERVFAIL, look at the authoritative servers or the network. The examples below use dnssec-failed.org, a public test domain with deliberately broken DNSSEC that the Ubuntu Server docs list as a name that should fail validation.

[1] Repeat the query against the same resolver with +cd. This one query splits the cases.

console
$ dig @1.1.1.1 dnssec-failed.org A +cd…;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38213;; flags: qr rd ra cd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1…;; ANSWER SECTION:dnssec-failed.org.	300	IN	A	96.99.227.255
Without +cdWith +cdMeaning
SERVFAILNOERROR + answerThe authoritative server answers; the resolver rejected the data because the signatures don't validate — DNSSEC
SERVFAILSERVFAILNot validation. Authoritative servers unreachable, broken delegation, network
NOERROR, ad in flags—Normal answer that passed validation

cd tells the resolver you accept unauthenticated data, so use it for diagnosis only. A correctly signed domain (checked with isc.org) shows ad (authenticated data) in the flags line.

[2] Read the EDE: line in the OPT PSEUDOSECTION. Resolvers that send Extended DNS Errors (RFC 8914) put the failure reason there, and the line stays in the +cd answer too.

EDEName (RFC 8914)Look at first
6DNSSEC BogusGeneric validation failure. Use delv for detail
7Signature ExpiredZone RRSIGs expired — has re-signing stopped?
8Signature Not Yet ValidSignature inception is in the future — resolver or signer clock
9DNSKEY MissingNo DNSKEY matches the parent's DS — key rollover or DNS provider move
10RRSIGs MissingA record set that should be signed has no signature
22No Reachable AuthorityAuthoritative servers not reached, before validation

[3] Ask two validating public resolvers to set the scope. 8.8.8.8 also returned SERVFAIL with EDE 9 for the same name, worded differently (No DNSKEY matches DS RRs of dnssec-failed.org). If both fail, the zone is broken. If only your internal or local resolver fails while the public ones return NOERROR with ad, check that resolver's clock and trust anchor. The Ubuntu docs note that a validator whose clock is outside the signature validity window will fail validation (check date -u first).

[4] Use delv to see where the chain of trust breaks. delv ships with dig (Ubuntu package bind9-dnsutils) and validates on its own. Without +cd you only get ;; resolution failed: failure, so add +cd to get the raw data and let delv do the validation:

console
$ delv @1.1.1.1 dnssec-failed.org A +cd;; validating dnssec-failed.org/DNSKEY: no valid signature found (DS);; no valid RRSIG resolving 'dnssec-failed.org/DNSKEY/IN': 1.1.1.1#53;; broken trust chain resolving 'dnssec-failed.org/A/IN': 1.1.1.1#53;; resolution failed: broken trust chain

(DS) means the DNSKEY set is not vouched for by the parent's DS. A broken signature looks different: the test name sigfail.ippacket.stream ended with RRSIG failed to verify.

[5] For your own domain, compare the DS key tag with the DNSKEY key IDs. The DS lives at your registrar (the parent zone) and the DNSKEY at your DNS provider, so they change independently.

console
$ dig @1.1.1.1 dnssec-failed.org DS +cd +noall +answerdnssec-failed.org.	3600	IN	DS	42069 13 2 62726F6B656E20636861696E206F662074727573742073656E642068 656C7021$ dig @1.1.1.1 dnssec-failed.org DNSKEY +cd +noall +answer +multiline | grep -E "DNSKEY|key id"dnssec-failed.org.	300 IN DNSKEY 257 3 13 (				) ; KSK; alg = ECDSAP256SHA256 ; key id = 50719dnssec-failed.org.	300 IN DNSKEY 256 3 13 (				) ; ZSK; alg = ECDSAP256SHA256 ; key id = 32784

The DS key tag (42069) doesn't match the KSK key id (50719) — exactly what EDE 9 said. The algorithm number (13) must match as well. Cloudflare's docs say this mismatch often happens when the authoritative nameservers change but the DS record is not updated.

[6] Pick the fix.

  • You moved DNS providers or rolled keys: enter the DS value your current provider gives you at the registrar. The old DS stays cached for its TTL.
  • You want to turn DNSSEC off: keep the order. Remove the DS at the registrar first, wait at least 1.5 times the DS TTL (36 hours for a 24-hour TTL, per Cloudflare's docs), then remove the DNSKEY records from the zone.
  • EDE 7 or 8: check automatic re-signing and the clock on the signing system.
  • Someone else's domain: only its operator can fix it. Turning off validation on your resolver removes spoofing protection for every name it serves.

[7] If a script checks with dig +short, it may be missing SERVFAIL. Here is the same name with +cd +short, then +short, then the exit code:

console
$ dig @1.1.1.1 dnssec-failed.org A +cd +short96.99.227.255$ dig @1.1.1.1 dnssec-failed.org A +short$ echo rc=$?rc=0

On SERVFAIL, +short prints nothing and exits 0. Have monitoring parse the status: line instead. If names don't resolve at all with Temporary failure in name resolution, see that guide; for nginx failing on variable upstreams, see nginx no resolver defined. If status: says REFUSED rather than SERVFAIL, the server declined the query by policy — see dig status: REFUSED.

If it is still SERVFAIL with +cd, also look beyond validation (the delegation or the authoritative server's answers) — see Unbound SERVFAIL with no EDE: lame delegation. For the meaning of the ad and cd flags, see dig ad and cd flags.

Check it with the dig output explainer tool ↗ — calculated in your browser.

#dns#dig#dnssec#servfail#delv