DNSSEC DS record mismatch: diagnose SERVFAIL and fix the DS
Validating resolvers return SERVFAIL with EDE 9 (DNSKEY Missing) while other users reach your site fine. Read the error code, compare the DS record with your DNSKEY and publish the right DS without a long outage.
Offensly Team··Updated ·5 min read
You query your own domain through a validating resolver and get this back:
$ dig A example.com @1.1.1.1
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 40212
;; OPT PSEUDOSECTION:
; EDE: 9 (DNSKEY Missing): (no SEP matching the DS found for example.com.)SERVFAIL alone tells you almost nothing. The EDE line tells you a lot. DNSKEY Missing means the DS record the parent zone publishes for you does not match any key-signing key in your zone. That is a DNSSEC DS record mismatch, and validating resolvers refuse to answer until it is fixed. Users behind non-validating resolvers still reach you, which is why the outage looks random.
Read the EDE code before you touch anything
Extended DNS Errors (RFC 8914) are returned by Cloudflare's 1.1.1.1 and several other public resolvers. They separate problems that all look like the same SERVFAIL:
| EDE you see | What it means | Where the fix is |
|---|---|---|
9 (DNSKEY Missing) | No key in your zone matches the DS at the parent | Registrar: replace the DS record |
7 (Signature Expired) | Your zone is signed, but the signatures ran out | DNS provider: signing stopped |
10 (RRSIGs Missing) | The parent expects signatures, your zone has none | DNSSEC was turned off at the provider, DS left at the registrar |
6 (DNSSEC Bogus) | A signature or proof does not verify | Usually the provider; check the detail text |
22 (No Reachable Authority) | Name servers did not answer | Not DNSSEC at all |
The codes and wording are listed in Cloudflare's EDE reference. To prove DNSSEC is the cause, repeat the query with +cd (checking disabled). If +cd returns your IP address and the normal query returns SERVFAIL, the chain of trust is broken and nothing else is.
This article covers code 9, the mismatch. If you see 7 or 10, the registrar is the wrong place to start.
Compare what the parent publishes with what you sign
$ dig DS example.com +short
2371 13 2 1F987CC6583E92DF0890718C42C3A2E7C1F9A1B2C3D4E5F60718293A4B5C6D7E
$ dig DNSKEY example.com +multiline
example.com. 3600 IN DNSKEY 257 3 13 (
mdsswUyr3DPW132mOi8V9xESWE8jTo0d
... ) ; KSK; alg = ECDSAP256SHA256 ; key id = 48211
example.com. 3600 IN DNSKEY 256 3 13 (
oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWz
... ) ; ZSK; alg = ECDSAP256SHA256 ; key id = 30907Look at two numbers. The DS record starts with key tag 2371. The only key with flag 257 (the KSK) has key id = 48211. They differ, so the DS points at a key that no longer exists. The 256 key is the zone-signing key and never appears in a DS record, so ignore it.
Two things here confuse people into breaking a working setup. Several DS records at the parent are fine: validation succeeds as long as one of them matches an active KSK, so do not delete the matching one while cleaning up. And the algorithm number must match too: a DS with algorithm 8 next to a KSK with algorithm 13 is still a mismatch, even if the key tag happens to fit.
Publish the DS record your provider actually signs with
Get the values from the provider that signs the zone, never from the old one.
Cloudflare. Go to DNS > Settings, find the DNSSEC card and select Enable DNSSEC if it is off. The dialog shows the DS values; later you can reopen them with the DS record button on the same card. Some registrars do not list algorithm 13 by number and call it "ECDSA Curve P-256 with SHA-256" (Cloudflare docs).
Amazon Route 53. Open Hosted zones, choose the zone, open the DNSSEC signing tab and select View information to create DS record. If the button is missing, signing is not enabled yet (AWS docs); enabling DNSSEC in Route 53 walks through the KMS key and KSK first.
Your own BIND servers. Compute the DS from the live key:
dig DNSKEY example.com | dnssec-dsfromkey -2 -f - example.comAt the registrar, add the new DS record first and delete the old one second. Use digest type 2 (SHA-256); RFC 8624 says SHA-1 (digest type 1) must not be used for new DS records. DS records live at the registrar, not in your zone file, which is the one exception to the usual steps for adding DNS records.
If you cannot get a correct DS today
Delete every DS record at the registrar. The domain becomes unsigned but reachable for everyone. That is a far better state than a signed domain nobody can validate, and you can turn DNSSEC back on once the provider shows you a DS record you trust.
Either way, resolvers keep the old DS until its TTL runs out. Read it from the second column of dig DS example.com (without +short). For .com it is a day, so a fix made in the morning may not be visible to every user until the next morning.
The provider move that causes most mismatches
Most mismatches appear right after a domain moves to a new DNS provider while the old DS stays at the registrar. Cloudflare's documented order avoids it: remove the DS at the registrar, wait out the DS TTL, switch name servers, wait out the old NS TTL, then enable DNSSEC at the new provider and add its DS. Changing name servers before the old DS has expired is exactly what produces the SERVFAIL above.
Some registries pick up DS changes automatically from CDS and CDNSKEY records published in your zone (RFC 7344, extended by RFC 8078). Check that both your registrar and your provider support it before you rely on it.
Confirm the chain is back
$ dig A example.com @1.1.1.1 +dnssec
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5531
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1NOERROR plus the ad flag means the resolver validated the answer. No EDE line should appear.
Who was affected while it was broken
Every user whose resolver validates DNSSEC, which includes the large public resolvers and many ISPs, lost the website, email delivery to your domain and any API on it at the same time. The error they saw never mentioned DNS. The registrar change takes minutes; the cached old record is what makes the outage last.
When the zone is stable again, it is a good time to review which certificate authorities may issue certificates for the domain. A broken chain also shows up there: CAs that cannot validate your CAA records refuse to issue, which the article on CAA issuewild and refused wildcards covers. The advanced DNS check in a free Offensly account, on a domain you have verified, reads the DS and DNSKEY records together with CAA and the rest of the zone.
Check your own domain in seconds
The free check reads your SPF, DKIM, DMARC and MX records and tells you exactly what to fix. No sign-up.