Changing a Domain's Nameservers Without Removing the DS Record First Makes DNSSEC-Validating Resolvers Return SERVFAIL
Overview
A stale DS record at the registrar breaks validating resolvers after a nameserver move. Remove it first and wait out its TTL.
At a glance
- Symptom
- The new provider shows every record correctly, and some users reach the site while others cannot.
- Likely cause
- When DNSSEC is enabled, the registrar publishes a DS record in the parent zone.
- Impact
- Everything under the domain stops resolving for users behind validating resolvers: the website, mail routing and any service using the domain.
- Verification signal
- The move is complete when dig +short DS example.com returns the new provider's DS, dig DNSKEY example.com +short returns keys that match it, and a normal query to…
- Safe correction
- Do this before any move, and in this order.
- Rollback or recovery
- If validating resolvers fail after the nameserver change, point the nameservers back at the old provider while its zone is still signed.
If you change a domain’s nameservers while the registrar still publishes a DS record for the old provider’s signing key, resolvers that validate DNSSEC return SERVFAIL for the domain, because the parent’s DS no longer matches any key the new provider serves. The fix is to remove the DS record at the registrar first, wait for its TTL to expire, then move the nameservers and add the new provider’s DS record.
Until the old DS record has expired from caches, putting the nameservers back at the old provider, while its zone is still signed with the key the DS names, is the quickest way to bring validating resolvers back.
Symptom
The new provider shows every record correctly, and some users reach the site while others cannot. Resolvers that validate DNSSEC answer with status SERVFAIL and no records; resolvers that do not validate answer normally. The pattern looks like a propagation delay, which is why the DS record is rarely the first thing checked.
$ dig A example.com @1.0.0.1
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL
Why this looks safe
Moving DNS hosting is ordinary work: recreate the zone at the new provider, check the records, change the nameservers at the registrar. Nothing in that sequence mentions DNSSEC, and the old provider’s signing may have been set up long ago by someone else. The DS record sits at the registrar, outside the zone you copied, so it is easy to leave behind.
Root cause
When DNSSEC is enabled, the registrar publishes a DS record in the parent zone. It contains a hash of the zone’s key signing key and metadata about the key. A validating resolver follows that chain: the parent says which key to expect, and the zone must answer with a matching key and valid signatures.
After the move, the new provider signs with its own keys, or not at all, but the parent still announces the old key. Cloudflare’s documentation states it plainly: if you change nameservers before the old DS TTL has fully expired, validating resolvers return SERVFAIL because the cached DS records do not match the new provider’s keys. It also states that if you change nameservers without disabling DNSSEC, DNSSEC prevents the new provider’s records from resolving properly.
RFC 4035 describes the resulting state as Bogus: the resolver believes it should be able to establish a chain of trust but cannot. The RFC adds that this may indicate an attack but may equally indicate a configuration error, so a validating resolver cannot tell a stale DS from a forgery and refuses the answer in both cases.
Impact
Everything under the domain stops resolving for users behind validating resolvers: the website, mail routing and any service using the domain. Because only validating resolvers fail, the outage is partial and hard to reproduce from a test machine, and it lasts until the old DS expires or is corrected. Cloudflare says the DS TTL is commonly 24 to 48 hours for most TLDs, so an unplanned fix can take a day or more to clear.
Shortcuts that make it worse
Under pressure, people reach for turning off DNSSEC validation on the resolvers they control, or telling users to switch to a resolver that does not validate. That makes the symptom disappear by discarding the protection the signatures give, for every domain, not only this one. Cloudflare’s guidance is that the same SERVFAIL can also appear when an attacker attempts to forge a response, so a resolver that stops enforcing DNSSEC cannot distinguish the two.
The other shortcut is to change the nameservers and replace the DS record in the same sitting. Cloudflare’s documented order puts a wait for the old DS TTL before the move, because resolvers that cached the old DS keep checking against it until it expires. Related failures of the same kind are covered in orphaned NS delegation and subdomain takeover and negative-caching defaults that outlast a failover window.
How to confirm the diagnosis without changing anything
These checks only read. Replace example.com with the domain.
- Read the DS record the parent publishes:
dig +short DS example.com. A value here means the registrar still announces a key for the domain. - See which parent nameserver returns it and its TTL:
dig DS example.com +trace. The TTL in the answer is how long resolvers may keep it. - Read the keys the zone now serves:
dig DNSKEY example.com +short. An empty answer, or keys that do not match the DS hash, confirms the mismatch. - Confirm that validation is the cause:
dig A example.com @1.0.0.1 +dnssec +cd +shortagainst a normal query. Cloudflare’s documentation says a proper answer with+cdbutSERVFAILwithout it means DNSSEC is misconfigured, and that this often follows a nameserver change where DS records were not updated.
Following along? Tap a step’s number to tick it off.
DNSViz, a free third-party visualiser, draws the same chain and shows when the authoritative servers return no DNSKEY matching the parent’s DS.
Correction
Do this before any move, and in this order. Where the old provider cannot add external DNSKEY records, the sequence below accepts a short period without DNSSEC protection, which is what RFC 6781 calls the only viable operation when the losing operator does not cooperate.
- Record the current state. Save the output of
dig +short DS example.com, the registrar’s DS entry and the old provider’s zone export. These are the backup for the rollback. - Remove the DS record at the registrar. Precondition: the new provider already serves every record the old one did. Do not change the nameservers yet.
- Wait for the DS TTL to expire at the parent. Run
dig DS example.comand wait until it returns nothing; Cloudflare says this is commonly 24 to 48 hours for most TLDs. - Change the nameservers at the registrar. Then wait for the previous NS record TTL to expire, which Cloudflare says is typically one hour or less.
- Re-enable DNSSEC at the new provider and add its DS record at the registrar, using the values the provider shows.
If both providers cooperate, RFC 6781 describes a pre-publish ZSK rollover combined with a double-signature KSK rollover, and Cloudflare documents a multi-signer path when the current provider can add external DNSKEY records. Either avoids the unprotected window, but both need the old provider’s support.
Validation
The move is complete when dig +short DS example.com returns the new provider’s DS, dig DNSKEY example.com +short returns keys that match it, and a normal query to a validating resolver returns an answer with the ad flag in the header. Cloudflare’s documentation says a response is DNSSEC authenticated when that flag appears. Check from at least one validating and one non-validating resolver.
Rollback
If validating resolvers fail after the nameserver change, point the nameservers back at the old provider while its zone is still signed. The old DS then matches again. Re-add the DS entry you recorded if it has been removed, and hold the move until the sequence above can be followed. Do not delete the old provider’s zone or signing keys until the new DS is live and validated, and keep the old zone export until the DS TTL has passed.
Stop it happening again
Add one line to the domain-move checklist: read dig +short DS for the domain before anything else, and treat a value as a blocker for the nameserver change. Record who holds the registrar DS entry, since it is often a different team from the one that runs DNS. Test the new provider’s zone against a validating resolver before cut-over, and schedule the nameserver change for the end of the DS wait rather than as a single step.
Apply the safer control
Before you change production
Confirm the affected scope, export the current configuration, and test the replacement control in a non-production environment first.
Fix commands and configuration
SERVFAIL$ dig A example.com @1.0.0.1
;; ->>HEADER<<- opcode: QUERY, status: SERVFAILexample.comWhen to escalate
Validation and rollback are covered in the sections above.
Escalate
Escalate when the blast radius is uncertain, the control cannot be tested safely, or remediation requires an outage or security exception.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Found this useful? Follow KBY for more like it.
