Skip to content
RU

DNS SERVFAIL (RCODE 2): Find Whether It Is DNSSEC or a Dead Nameserver

What it means: The resolver tried to answer but failed: validation broke or no authoritative server gave a usable reply.

  1. Repeat the query with dig +cd
  2. If +cd works, fix DNSSEC
  3. Query every NS with +norecurse
  4. Make all nameservers serve the zone
  5. Read the EDE code if shown

Test your URL now

Looks the name up in public DNS and shows every record it returns.

Check your domain's DNS →

What SERVFAIL means

SERVFAIL is DNS response code 2. RFC 1035 defines it as «Server failure - The name server was unable to process this query due to a problem with the name server.» In practice it almost always comes from a recursive resolver (your ISP, 8.8.8.8, 1.1.1.1, a corporate DNS) that could not produce an answer it trusts:

$ dig www.example.com @8.8.8.8
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 31337
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

Unlike NXDOMAIN, SERVFAIL says nothing about whether the name exists. It means «I could not find out». RFC 2308 allows resolvers to cache a server failure, but for no longer than five minutes, so a fix shows up quickly.

Modern resolvers often attach an Extended DNS Error (RFC 8914) to the SERVFAIL. Recent dig versions print it in the OPT pseudo-section, and it names the cause directly.

Causes and the EDE codes that point to them

CauseEDE code (if sent)How to recognise it
DNSSEC signatures expired7 Signature Expireddig +cd answers; RRSIG expiration date is in the past
DS at the registry does not match the zone's DNSKEY6 DNSSEC Bogus, 9 DNSKEY MissingHappens right after changing DNS provider with DNSSEC on
All authoritative servers unreachable or refusing22 No Reachable AuthorityQueries to each NS time out or return REFUSED
Network problem between resolver and servers23 Network ErrorFails from one resolver, works from others
A nameserver listed but not configured for the zone (lame)often noneOne NS answers REFUSED or without the aa flag
Broken zone on the primary serveroften noneThe server logs a zone load error

The DNSSEC row is the most common cause for a domain that «worked yesterday». Validating resolvers (8.8.8.8, 1.1.1.1, 9.9.9.9) return SERVFAIL when signatures do not verify, while a non-validating resolver still answers. That split, one resolver failing and another working, is itself a strong DNSSEC signal.

How to fix it

  1. Disable validation for one query. The +cd flag asks the resolver not to perform DNSSEC validation:
    dig www.example.com @1.1.1.1 +cd +short
    An answer with +cd and SERVFAIL without it means the zone's DNSSEC chain is broken.
  2. Compare the DS record at the parent with the zone's keys:
    dig DS example.com +short
    dig DNSKEY example.com +short @ns1.example.com
    dig www.example.com +dnssec @ns1.example.com | grep RRSIG
    If the DS key tag matches no DNSKEY, publish the new DS at the registrar or remove the DS to turn DNSSEC off while you fix it. Check RRSIG expiry dates too. Walkthrough: how to check DNSSEC.
  3. Query every authoritative server directly:
    for ns in $(dig +short NS example.com); do
      echo "== $ns"; dig @"$ns" www.example.com A +norecurse +time=3 +tries=1 | grep -E 'status|flags'
    done
    Each must answer NOERROR (or NXDOMAIN) with the aa flag. A timeout, REFUSED or a missing aa flag marks a dead or lame server: remove it from the delegation or configure the zone on it.
  4. Follow the chain from the root with dig +trace www.example.com to see which step stops answering.
  5. If only your own resolver fails, check that it can reach the Internet on port 53 over both UDP and TCP and that its root hints and trust anchor are current.

Changing DNS provider without SERVFAIL

Most DNSSEC outages happen during a provider move. The registry still publishes a DS record that matches the old provider's signing key, the new provider signs with a different key (or not at all), and every validating resolver fails the domain. The safe order: remove the DS record at the registrar, wait for the DS TTL to expire, move the nameservers, then enable DNSSEC at the new provider and publish its DS. Background: DNSSEC.

How to confirm the fix

dig www.example.com @8.8.8.8 | grep status
# status: NOERROR
dig www.example.com @1.1.1.1 +dnssec | grep -E 'status|flags'
# flags: qr rd ra ad;   (ad = validated)

Run it against at least two validating resolvers; a cached failure clears within five minutes. The DNS lookup shows what public DNS returns for the name right now.

Related errors

A / AAAAIPv4 and IPv6 host addresses
MX RecordsDomain mail servers
TXT / SPFVerification & anti-spoofing
NS / SOAName servers & zone authority

Why teams trust us

12
DNS record types
SPF+DKIM
email protection
<1s
DNS response
3
check regions

How it works

1

Enter domain

2

Select record type

3

Get DNS response

What are DNS Records?

DNS (Domain Name System) translates domain names into IP addresses. DNS records are instructions that define where to route traffic, email, and how to verify domainownership.

Complete Lookup

Query all record types — A, AAAA, MX, NS, TXT, CNAME, SOA — in a single request.

Instant Results

Direct queries to authoritative servers. Results in milliseconds, no caching.

Security Checks

SPF, DKIM, and DMARC analysis to evaluate email protection against spoofing and phishing.

Export & History

Save check results. Compare DNS records before and after registrar changes.

Who uses this

DevOps

DNS check after deploy

Email marketers

SPF/DKIM/DMARC audit

SEO

DNS config audit

Sysadmins

DNS zone control

Common Mistakes

Missing SPF recordWithout SPF, emails may land in spam. Add a v=spf1 TXT record.
Single NS serverIf the only NS fails, the domain becomes unreachable. Use at least 2 NS servers.
CNAME conflicting with other recordsCNAME cannot coexist with MX or TXT on the same name — this violates RFC.
TTL set too highWith 86400s TTL, DNS changes take a full day. Lower TTL to 300 before migrations.
Missing PTR recordMail servers check PTR. Without it, emails may be rejected.

Best Practices

Set up SPF + DKIM + DMARCThe trio of records that protects your email from spoofing and improves deliverability.
Use 2+ NS serversDistribute NS servers across different networks for redundancy.
Lower TTL before migrationSet TTL to 300 at least 24-48 hours before an IP change for fast propagation.
Verify DNS after changesAfter updating records, confirm changes propagated correctly and no errors remain.
Add a CAA recordCAA restricts which Certificate Authorities can issue SSL certificates for your domain.

Get more with a free account

DNS check history, API keys and DNS change monitoring.

Sign up free

Learn more

Sources

Frequently Asked Questions

What does SERVFAIL mean in dig?

The resolver could not produce an answer: DNSSEC validation failed or no authoritative nameserver gave a usable reply. It does not say whether the name exists.

Why does a domain return SERVFAIL on 8.8.8.8 but resolve on my router?

8.8.8.8 validates DNSSEC and many home routers do not. A broken DNSSEC chain fails only on validating resolvers. Confirm with dig +cd.

How long is SERVFAIL cached?

RFC 2308 lets resolvers cache a server failure for at most five minutes, so a fix is visible quickly.

What is the difference between SERVFAIL and REFUSED?

REFUSED means a server declined to answer, often because it is not configured for that zone. A resolver that gets REFUSED from every nameserver returns SERVFAIL to you.

Can SERVFAIL be caused by my nameserver provider?

Yes. If all listed nameservers are down, refuse the zone, or serve expired DNSSEC signatures, every validating resolver returns SERVFAIL.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.