When dig returns status: SERVFAIL, many people assume the domain is down. They suspect crashed nameservers, a suspended hosting account, or a zone the registrar dropped. Often none of that is true. The authoritative servers are up and answering normally, but the resolver you asked checked the zone's DNSSEC signatures, found a problem, and refused to pass the answer on. One extra flag on dig tells you which of these situations you are in.
Why "SERVFAIL means down" falls apart
SERVFAIL is a generic error. NXDOMAIN means the name does not exist. SERVFAIL means something went wrong on the resolver's side while it tried to answer, as the DyNS glossary puts it. An authoritative server that times out, a broken delegation, and a failed DNSSEC check all produce the same status code.
The DNSSEC case confuses people because the resolver received an answer. A validating resolver does more than fetch records. It also fetches the RRSIG records, which are cryptographic signatures over each record set, and follows a chain of trust. The chain starts at the root zone, goes through the DS (Delegation Signer) record that the parent zone such as .com publishes for your domain, and ends at the DNSKEY records inside your zone. If any link in that chain fails, the resolver treats the answer as "bogus". It returns SERVFAIL so that it never hands out data that might be forged.
This behavior protects users from forged answers. It also makes the symptom inconsistent. Resolvers that validate fail the lookup, while resolvers that skip validation keep answering. A site can load on one network and fail on another, so customers often report that it works on mobile data but not on the office Wi-Fi. When a support engineer sees that pattern alongside SERVFAIL, DNSSEC is one of the first things worth ruling out.
What usually breaks the chain
Two failures cover most cases.
Expired signatures. Every RRSIG has an inception time and an expiration time. The signing system has to re-sign the zone before the expiration time arrives. If signing stops, the authoritative servers keep serving the zone with the old signatures. Signing can stop when a re-signing job fails, when someone copies a signed zone file to a server that serves it as static data, or when inline signing is turned off. Queries sent straight to the authoritative servers still look normal. Validators start rejecting the zone once the expiration time passes. Clock problems can cause the reverse case: a resolver whose clock runs behind can treat valid signatures as not yet valid.
DS mismatch. The DS record at the parent must match a key-signing key (KSK) published in the zone's DNSKEY set. This link breaks in two common ways. A domain moves to a new DNS provider that signs with its own keys, or does not sign at all, while the registrar still holds the old DS. A KSK gets rolled and nobody updates the DS at the registrar. The DS-after-rollover case is covered in more depth in this article on checking DS records with dig +dnssec.
In both cases nothing on the web server or the nameserver looks wrong. The failure only shows up when someone validates the zone.
Compare dig with and without +cd
The +cd flag sets the CD (Checking Disabled) bit in the query, as defined in RFC 4035. It asks the resolver to return the data without validating it. If the plain query fails and the +cd query succeeds, the data is reachable and validation is the thing failing. Cloudflare's DNSSEC troubleshooting docs describe the same test: if +cd returns NOERROR with real addresses, DNSSEC is misconfigured.
Run both queries against a resolver you know validates:
# Normal query: the resolver validates DNSSEC
dig @1.1.1.1 example.com A
# Same query with validation disabled
dig @1.1.1.1 example.com A +cd
Illustrative output format, trimmed to the header lines that matter:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1111
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
; EDE: 7 (Signature Expired)
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2222
;; flags: qr rd ra cd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; ANSWER SECTION:
example.com. 300 IN A 192.0.2.10
The first response is the normal query and the second is the +cd query. Newer versions of dig show the EDE line when the resolver supports Extended DNS Errors (RFC 8914). EDE codes such as Signature Expired, DNSSEC Bogus, or DNSKEY Missing point you toward the cause. Older dig versions and some resolvers do not show this line, so don't rely on it being there.
Keep these limits of the test in mind:
- If the resolver does not validate, both queries succeed and the comparison tells you nothing. Test against a resolver you know validates.
- If
+cdalso returns SERVFAIL or times out, the problem is probably not DNSSEC. Move on to the delegation and the authoritative servers. Tracing the authoritative path with dig +trace covers that path. - A
+cdsuccess shows that validation is failing. It does not show which link failed, so you still need to check the signatures and the DS record.
Read RRSIG expiry and compare DS with DNSKEY
Query an authoritative server directly with recursion off, so you see what the zone actually serves rather than what a resolver has cached. Replace ns1.example.net with one of the domain's real nameservers. dig example.com NS +short lists them.
# Signatures as served by the authoritative server
dig @ns1.example.net example.com A +dnssec +norec +multi
# DS at the parent, as a resolver sees it
dig example.com DS +short
# Keys in the zone; +multi prints a key id comment for each key
dig @ns1.example.net example.com DNSKEY +norec +multi
An RRSIG record lists its fields in this order: type covered, algorithm, labels, original TTL, signature expiration, signature inception, key tag, signer name, and the signature itself. The two timestamps use the format YYYYMMDDHHMMSS in UTC. Compare the expiration timestamp with the current UTC time (date -u). If the expiration is in the past, you have found the problem. If it is only a few hours away and the zone has not been re-signed recently, the signer has probably stopped and the zone is about to fail.
For the DS check, the output of dig DS +short starts with the key tag, followed by the algorithm, the digest type, and the digest. In the DNSKEY output, +multi labels each key with a comment such as KSK and key id. The DS key tag should match the key id of a KSK, which is a DNSKEY with flags 257, and the algorithm numbers should match too. If the DS points to a key id that no longer exists in the zone, the chain is broken at the parent.
If you have the BIND utilities installed, delv performs validation locally and usually states the reason for a failure more directly than dig does. The exact wording of its messages varies between versions.
Fix it without making things worse
The fix depends on which link failed.
For expired signatures, restore re-signing and confirm that the authoritative servers serve the new RRSIGs. With a managed DNS provider this is on their side, so check their DNSSEC status page or settings. With self-hosted BIND or another signer, check the signing job and the zone serial. After the fix, some resolvers may keep returning SERVFAIL for a while because they cache the bogus result. How long depends on the resolver software and its configuration.
For a DS mismatch, update the DS at the registrar to match the zone's current KSK. If the zone is no longer signed at all, remove the DS at the registrar.
Warning before removing a DS record: removing it turns off DNSSEC protection for the domain. Changes at the parent zone also take time to take effect, because of registry publishing delays and the TTL of the old DS record. Do not remove the old DNSKEY from the zone while the parent still publishes a DS that points to it. Doing that turns a working zone into a broken one.
To avoid this during a DNS provider migration, follow this order:
- Remove the DS record at the registrar.
- Wait at least the DS TTL so resolvers drop the cached DS.
- Switch the nameservers to the new provider.
- Turn on signing at the new provider.
- Publish the new provider's DS record at the registrar.
An alternative is to have the new provider sign the zone and add its DS record before you switch. This takes more coordination between the two providers.
For monitoring, a check that only confirms the authoritative servers answer will report healthy throughout a DNSSEC outage. Add a check that queries a validating resolver and alerts on SERVFAIL. Add a second check that reads the RRSIG expiration time and alerts when it gets close, with enough margin to fix the signer before signatures expire.
When you see SERVFAIL, run the same query with +cd before concluding the domain is down. If +cd works, the servers are fine and validation is failing. Then read the RRSIG timestamps from an authoritative server and compare the DS key tag against the zone's KSK. That usually tells you within a few minutes whether the cause is an expired signature or a stale DS record, and which side of the registrar boundary has to fix it.