PREP WITH PROOF
Menu
NETWORKING & TROUBLESHOOTING / PRACTICAL GUIDE

NXDOMAIN vs SERVFAIL: A Practical DNS Troubleshooting Guide

Distinguish NXDOMAIN, SERVFAIL, NODATA and DNS timeouts. Follow a dig-based workflow for resolver caches, authoritative servers, delegation and DNSSEC.

THE QUICK ANSWER

NXDOMAIN reports that a queried name does not exist along the resolution path being used. SERVFAIL reports a server failure to complete the lookup; it does not establish that the name is absent. Before changing records, capture the exact name, record type, resolver, response code and authority information. Also distinguish an existing name without the requested record type from a lookup that received no response.

Classify the reply before choosing a fix

An application reports “host not found,” but that message may hide several different DNS outcomes. A newly introduced hostname could be missing, an authoritative server could be unreachable, or a validating resolver could reject inconsistent DNSSEC data. Changing an A record is useful only for some of those cases. Start with the DNS response rather than treating the application’s wording as a diagnosis.

NXDOMAIN is the name-error response code, numerically 3. SERVFAIL is server failure, code 2. NODATA is not a separate response code: it describes an answer indicating that the requested record set is absent, under NOERROR. A timeout is different again: the client did not receive a usable reply within its waiting period, so it has no response code from that attempt.

The table is a triage guide, not proof of a root cause. A response may reflect a cache, a particular DNS view, an alias target, or local resolver policy. Keep those possibilities visible. In particular, an empty answer section alone is insufficient to classify NODATA: examine referrals, the authority section, and any alias chain.

Observed outcomeWhat it tells youUseful next question
NXDOMAIN / code 3The resolution result reports nonexistence of a name.Which name in the question or alias chain is absent, and in which DNS view?
SERVFAIL / code 2The server could not complete the requested resolution.What do authority reachability, delegation, DNSSEC and diagnostic details show?
NOERROR with a negative record-set answerThe requested type is absent; this may be NODATA.Does another expected type exist, and does the authority information support the classification?
No reply / timeoutThis attempt did not obtain a usable response.Can the client reach the chosen DNS server using the expected transport?

Source: RFC 9499: current DNS terminology ↗

Capture one reproducible question

Use dig from BIND DNS utilities if it is installed. The commands below are a walkthrough, not output from an incident or a claim that these network queries were executed here. Replace the example name, zone, resolver and authoritative-server address before running them. The 192.0.2.x addresses are documentation placeholders and will not diagnose your own network.

The trailing dots make the names explicit absolute DNS names. Record the client network, VPN state, timestamp and selected server along with the output. Later command blocks assume these shell variables remain set. Use the resolver that the affected application is meant to use; querying an unrelated resolver first can hide the failing path.

Keep the header, question, answer, authority and additional information during the initial investigation. Short output that displays only an address is convenient after a fix, but it can discard the clues that distinguish a negative answer from a resolution failure. Also confirm whether the application uses the operating system resolver, a browser-specific DNS path, or a custom client.

# Replace every placeholder with the values for your investigation.
dns_name='www.example.com.'
dns_zone='example.com.'
dns_resolver='192.0.2.53'
dns_auth='192.0.2.54'

dig @"$dns_resolver" "$dns_name" A +time=2 +tries=1
dig @"$dns_resolver" "$dns_name" AAAA +time=2 +tries=1

Source: BIND 9: dig and DNS diagnostic utility reference ↗

For NXDOMAIN, verify the name, view and alias target

Check the exact spelling and full name before changing infrastructure. A missing environment label or an unexpected search suffix can turn an intended query into a different name. Compare the question in the DNS output with the application configuration, not just with a hostname copied from a dashboard. Then check which zone should be authoritative for that name.

If the answer contains a CNAME, follow the chain through its target names. A source alias can exist while a later target does not. Fixing the alias owner’s A record may be the wrong change, particularly when the alias intentionally points to a provider-managed hostname. Identify the absent name and the organization responsible for it.

For a private hostname, compare from the intended private network and resolver path. A public resolver’s negative answer does not disprove the existence of a record in a private DNS view. Avoid sending private service names to arbitrary public resolvers during a comparison. The related Private Endpoint DNS article covers this split-view investigation in an Azure-specific setting.

If the record was recently created, compare the authoritative result with the resolver result before concluding that the creation failed. Preserve the negative response and its authority information. Recreating the record repeatedly can introduce new changes without addressing an older cached negative result.

Account for negative caching, including resolution failures

NXDOMAIN and NODATA answers can be negatively cached. Under RFC 2308, the authoritative negative-answer TTL is derived from the smaller of the SOA record’s TTL and its MINIMUM field. The remaining negative-cache time is therefore not simply the TTL you assigned to a new A record. Inspect the SOA information accompanying the negative answer when it is available.

Suppose, as a hypothetical example, a resolver queried a missing name before you published it. The authoritative server now returns the new record, but the resolver still has an eligible negative cache entry. That difference suggests checking the negative-cache lifetime and resolver behavior. It does not justify declaring all resolvers broken or repeatedly editing the same record.

Do not assume SERVFAIL always forces a brand-new recursive lookup either. RFC 9520 updates resolution-failure caching requirements, including caching DNSSEC validation failures. Treat nonexistence caching and failure caching as different mechanisms, and consult the resolver’s actual behavior and configuration. An immediate retry may reproduce cached failure evidence rather than test a repaired authority.

Source: RFC 2308: negative caching of DNS answers ↗

Compare the resolver with the intended authorities

The commands below ask one chosen authoritative server directly without requesting recursion, then inspect the zone’s NS information through the resolver. Repeat the direct checks for each expected authoritative server. A single successful reply establishes only that one queried endpoint answered that particular question from your test location.

Examine the AA flag when expecting an authoritative reply, the response code, the returned records, and SOA serials where useful. Different serials can help investigate an incomplete update, but matching serials alone do not prove that every relevant answer is correct. A reachable server may also be the wrong authority or serve a different view.

Check parent-side delegation separately from the child zone’s own NS records and your DNS hosting dashboard. A correct record at a server that clients are not delegated to will not repair the normal resolution path. Compare the registrar or parent-zone delegation with the intended authoritative service, especially after a nameserver migration.

The final command performs an iterative trace from the machine running dig. Use it to inspect referrals, not as an exact reproduction of the configured recursive resolver. A restricted network can block the trace’s direct queries while allowing its normal resolver to work. Record that limitation rather than interpreting every failed trace as a broken public delegation.

dig @"$dns_auth" "$dns_name" A +norecurse +time=2 +tries=1
dig @"$dns_auth" "$dns_zone" SOA +norecurse +time=2 +tries=1
dig @"$dns_resolver" "$dns_zone" NS +time=2 +tries=1

# This uses direct iterative queries from the test machine.
dig "$dns_name" A +trace

Source: BIND 9: dig and DNS diagnostic utility reference ↗

For SERVFAIL, look for a more specific explanation

SERVFAIL is a category of failure, not a DNSSEC diagnosis. Before choosing a fix, collect any Extended DNS Error information in the response and the resolver’s logs if you operate it. RFC 8914 defines EDE as additional diagnostic information; it does not replace the response code or change how that code is processed.

A resolver may report a DNSSEC-related error, an unreachable authority, or a network-related problem. Use that information to select the next observation. For example, an authority-reachability report points toward the servers and path involved, while a validation report points toward the trust chain and signed data. Neither should trigger a blind record change.

Absence of EDE does not rule out those causes. Servers and client tools do not always expose the same diagnostic details. Preserve the full response and avoid automating a permanent remediation based only on free-form error text. The exact question, source resolver and time remain part of the evidence.

Source: RFC 8914: Extended DNS Errors ↗

Inspect DNSSEC evidence without treating bypass as a repair

DNSSEC validation failures are one possible reason a validating resolver returns SERVFAIL. A nameserver migration can leave parent-side DS information inconsistent with the keys served by the child, while missing or invalid signatures can cause other failures. Google’s domain troubleshooting guidance gives examples of these problems and the diagnostic details its resolver can expose.

The queries below request DNSSEC-related data for inspection. The +dnssec option asks for DNSSEC records; seeing such records in dig output is not itself a complete local validation of the chain. Compare the parent-side DS information, the child’s DNSKEY data and signature evidence with the authoritative provider’s intended configuration.

An unsigned delegation is not automatically a configuration failure, and a SERVFAIL result is not proof that a DS record should be removed. Establish the intended signing state and follow the provider’s correct repair workflow. Disabling validation or switching callers to a nonvalidating path can hide the symptom while leaving the underlying DNSSEC inconsistency unresolved.

dig @"$dns_resolver" "$dns_name" A +dnssec +time=2 +tries=1
dig @"$dns_resolver" "$dns_zone" DS +dnssec +time=2 +tries=1
dig @"$dns_auth" "$dns_zone" DNSKEY +dnssec +norecurse +time=2 +tries=1

Source: Google Public DNS: domain troubleshooting ↗

Separate transport trouble from a DNS response code

Compare an ordinary lookup with one forced over TCP. This can help investigate response-size and transport-path issues, but it is not a standalone proof of their cause. A normal dig lookup can already fall back to TCP after truncation, so “ordinary” and “UDP only” are not interchangeable labels. Preserve the flags and any timeout or fallback messages.

If results differ, investigate client-to-resolver access separately from resolver-to-authority access. Your successful direct query does not establish that the recursive resolver can reach every authoritative endpoint, and a resolver’s failure does not necessarily mean the client’s own outbound path is broken. Ask which component sent each query.

A two-second timeout in these examples is a deliberate troubleshooting setting, not an availability target. Repeat only enough to establish whether the symptom is consistent, and retain timestamps. Aggressive repeated queries can add load without improving the diagnosis; failure caching can also make repetitions less independent than they appear.

dig @"$dns_resolver" "$dns_name" A +time=2 +tries=1
dig @"$dns_resolver" "$dns_name" A +tcp +time=2 +tries=1

Source: Google Public DNS: domain troubleshooting ↗

Close the incident with the same question and path

After a change, repeat the original query from the original client path and compare it with the intended authorities. Confirm the record type the application actually needs; an A lookup succeeding is not enough if the application is failing on another name or type. Then confirm application behavior separately, since DNS success does not establish that the service behind the address is healthy.

Keep a compact incident record: question name, type, resolver, DNS view, response code, relevant authority or EDE evidence, identified cause, change made and post-change result. Label example commands and hypothetical scenarios as such. A useful conclusion says which observation changed after the repair, not merely that enough time passed.

The practical sequence is classification, path comparison, targeted investigation and verification. NXDOMAIN calls for investigating reported nonexistence; SERVFAIL calls for investigating why resolution failed. Keeping those questions separate helps you choose a correction that matches the evidence and makes later recurrences easier to diagnose.

KEEP THESE THREE THINGS

Your next steps

  1. Capture the exact name, type, resolver and full response before editing DNS.
  2. Separate NXDOMAIN, NODATA, SERVFAIL and timeouts; account for both negative answers and cached failures.
  3. Compare authoritative data, delegation, DNSSEC and transport evidence, then verify the original application path.

Sources & official resources

Linked resources checked on 2026-10-23. Technical behavior and provider guidance can change; check the documentation for the version you use.

About this guide and its recommendations

Published by Prep With Proof with AI-assisted drafting. Study routines and examples are editorial suggestions, not official exam instructions or claims of a learner's personal results. Cited provider facts are linked; ownership of recommended Prep With Proof products is disclosed. No competitor endorsement or guaranteed certification outcome is implied.

Suggest a correction →