NXDOMAIN, SERVFAIL and REFUSED: what each DNS error means
NXDOMAIN means the DNS server says the name does not exist, SERVFAIL means the server could not process the query because of its own problem, and REFUSED means the server declined the query for policy reasons. Each points to a different place to look.
- NXDOMAIN: the name does not exist. NODATA: the name exists but not that record type.
- SERVFAIL: the server failed. Check the zone and DNSSEC on the authoritative side.
- REFUSED: the server will not answer you, often because it is not meant to serve that zone or client.
What does each response code mean?
| Code | Meaning | Typical causes | Where to look |
|---|---|---|---|
| NXDOMAIN (3) | The name does not exist | Typo, missing record, expired domain, wrong delegation | Zone contents, registration, nameservers |
| SERVFAIL (2) | The server could not process the query due to its own problem | Broken or unreachable authoritative servers, zone errors, DNSSEC validation failure | Authoritative servers, zone, DNSSEC |
| REFUSED (5) | The server refuses the operation for policy reasons | Server not configured for that zone or for your client address, restricted recursion | Server access rules and zone configuration |
| NOERROR with no answer (NODATA) | The name exists but has no record of the requested type | Querying AAAA or MX on a name that lacks them | Record types in the zone |
Definitions from RFC 8499, section 3. The causes column reflects common operational experience and varies by software.
How do these look in dig output?
dig nosuchname.example.com A +noall +comments
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN
dig example.com A +noall +comments
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL
dig @ns.other-host.net example.com A +noall +comments
;; ->>HEADER<<- opcode: QUERY, status: REFUSEDHow do you narrow down a SERVFAIL?
- 01
Query the authoritative servers directly
Use
dig @ns1... example.com A +norecurse. If they answer correctly, the failure is between the resolver and them. - 02
Check that every listed nameserver answers
A single dead or lame nameserver in the NS set can cause intermittent failures.
- 03
Check DNSSEC
If the zone is signed, a mismatch between the DS record at the registry and the zone's keys makes validating resolvers return SERVFAIL. Compare with
dig +dnssec. - 04
Try a non-validating test
Run
dig +cd example.com A(checking disabled). If it works with +cd, DNSSEC validation is the cause.
Quick triage for any DNS error code
- Read the status in dig output before changing anything.
- Ask a second public resolver; the same code from both means the source is at fault.
- Ask the authoritative nameserver directly with +norecurse to bypass caches.
- For NXDOMAIN check spelling, records, expiry and delegation.
- For SERVFAIL check every nameserver and DNSSEC.
Good to know
Response codes come from the DNS server, but what you see depends on the resolver in between. A recursive resolver may turn an upstream failure into SERVFAIL, so the code you see is not always the authoritative server's own code.
That is why testing both through a resolver and directly against the authoritative nameserver is the dependable way to place the fault.
Common questions
What is NXDOMAIN?
NXDOMAIN is the DNS response code "Name Error" and signals that the queried domain name does not exist. RFC 8499 notes it is the same as Name Error in older documents. The resolver may cache this negative answer for a period.
What causes a SERVFAIL?
SERVFAIL means the server could not process the query because of a problem with the server. In practice that includes unreachable authoritative nameservers, broken zone data and DNSSEC validation failures. Query the authoritative servers directly to locate the failure.
What does a REFUSED response mean?
The DNS server declined to perform the operation for policy reasons. Often you queried a server that is not authoritative for the zone, or one that does not allow recursion for your address.
Is NXDOMAIN the same as no records found?
No. NXDOMAIN says the name itself does not exist. If the name exists but lacks the record type you asked for, the response is NOERROR with an empty answer, called NODATA. For example, a name with A records but no AAAA.
Why do I see SERVFAIL on one resolver but not another?
Resolvers differ in caching, DNSSEC validation and which authoritative servers they reach. A validating resolver returns SERVFAIL for a broken DNSSEC chain while a non-validating one answers normally, so compare two resolvers and test with checking disabled.
Keep reading
Watch your domains automatically
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.