About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When dig prints status NOERROR and the answer section has no record of the type you asked for, the name is real and that type is not. RFC 2308 calls this NODATA: "a pseudo RCODE which indicates that the name is valid, for the given class, but are no records of the given type." It is indicated by "an answer with the RCODE set to NOERROR and no relevant answers in the answer section." There is no RCODE number for NODATA. "NODATA responses have to be algorithmically determined from the response's contents as there is no RCODE value to indicate NODATA."
NXDOMAIN is the other negative answer. That RCODE means the name does not exist. Creating the name will not fix NODATA, because the name is already there. Adding a record of a type the name should not have will not fix a query for the type you actually need.
What the symptom means
RFC 1035's RCODE 0 is "No error condition". NOERROR with answers means those records exist. NOERROR without relevant answers is NODATA. The authority section "will contain an SOA record, or there will be no NS records there." That SOA is how you tell NODATA from a referral. RFC 2308 says you distinguish them "by the presence of a SOA record in the authority section or the absence of NS records in the authority section."
An authoritative server "MUST include the SOA record of the zone in the authority section of the response when reporting an NXDOMAIN or indicating that no data of the requested type exists." The TTL on that SOA is "the minimum of the MINIMUM field of the SOA record and the TTL of the SOA itself", and it is how long a resolver may cache the negative answer.
NODATA is cached for the same query name, type and class. A cached NODATA for A does not answer an MX query. A cached NXDOMAIN is stored for the name and class, without the type. After you add the missing type, resolvers can keep returning the empty NOERROR until that negative TTL reaches zero.
dig return code 0 means "DNS response received, including NXDOMAIN status". An empty NOERROR is also a response. The exit code does not show the status or the empty answer. The manual says +short "toggles whether a terse answer is provided" and that the default is the verbose form. A terse reply with no answer lines gives no status, so use the verbose form to see NOERROR or NXDOMAIN.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| The name exists and has no record of this type | NOERROR, answer section empty, SOA in the authority section | Verbose dig for that type |
| You asked for A and the name has only MX, or the reverse | NODATA for the type you typed, and data for another type | Query the other type |
| A resolver cached NODATA | The authoritative server now has the record, and your resolver still returns an empty NOERROR | Compare dig with no @ to dig @ the authoritative server |
| The name does not exist | NXDOMAIN, not NOERROR | The status line |
| The reply is a referral | NOERROR, no SOA, NS records in the authority section | RFC 2308's distinction |
Prove the cause before changing anything
All of these are read-only. The manual's form is dig @server name type. Leave the reply verbose.
1. Read the status and the answer. Do not use +short.
dig www.example.com A
NOERROR and no A record in the answer is NODATA for A, once you have also checked it is not a referral. NXDOMAIN means the name is missing. The header status is the difference.
2. Ask for the type you expected, and for a type you know.
dig +noall +answer www.example.com A
dig +noall +answer www.example.com MX
The manual's example dig +noall +answer example.com shows "just the name, record type, TTL, and value for each answer". One type empty and another type present is NODATA for the empty type. Both empty, with status NXDOMAIN on the verbose query, is a missing name.
3. Ask the authoritative server.
dig +noall +answer example.com NS
dig @ns1.example.net www.example.com A
If this server returns the record and your resolver returns NODATA, the resolver is serving a cached negative answer.
4. Read the negative TTL if the record is already published and resolvers are still empty.
dig +noall +answer example.com SOA
The cache time is the lesser of the SOA MINIMUM and the TTL on the SOA record. MINIMUM is the last field of the SOA. A NODATA cache entry is for that name and that type. It "MUST NOT be used again" once the TTL reaches zero.
Fix
A record of the missing type belongs in the zone only when that type should exist. If the name is supposed to have no A record, the empty NOERROR is the correct answer.
Save the current records for the name first, with these commands. Use the authoritative server from step 3, and repeat the second command for each type already present:
dig +noall +answer @ns1.example.net www.example.com A > a-before.txt
dig +noall +answer @ns1.example.net www.example.com MX > mx-before.txt
The first file is empty if the name has no A record yet, which is the case this section fixes.
Risk: the next step publishes an A or MX record, which causes resolvers to use it as soon as they drop the cached NODATA. The wrong address or the wrong mail server then receives the traffic for a full TTL. Adding the record in a zone the delegation does not use leaves the public answer empty.
Add the record on the authoritative servers for the zone. Use the type the application queries.
To undo it, delete the one record you added, the one that the empty file for that type shows was not there before. Leave the records saved in the other files as they are. The name returns to NODATA for that type after caches expire the positive answer.
Example (illustrative): www.example.com has an MX record and no A record. dig www.example.com A is NOERROR with an empty answer. dig www.example.com MX returns the mail server. A browser needs an address. The administrator saves both replies, adds an A record at 203.0.113.20, and the authoritative query for A returns that address. Resolvers that cached NODATA for A stay empty until the negative TTL reaches zero. Deleting 203.0.113.20 is the back-out. The MX record is untouched.
Confirm the fix
dig @the authoritative server for the type you added returns the record, status NOERROR, with the record in the answer.- The same query for a type you did not add is unchanged.
- After the negative TTL, a query with no
@returns the new record. Until then, an empty NOERROR from a resolver can be the cached NODATA.
What to watch afterwards
- A new application that queries a type you never published will see NODATA until that type exists.
- Deleting the last record of a type, while leaving other types, moves that type to NODATA.
- A terse
+shortreply shows no status, so it cannot tell NODATA from NXDOMAIN.
Read next
Related articles you may want next.
- Troubleshootingdig NXDOMAIN for a subdomain that should existdig returns NXDOMAIN for a subdomain you expected. Read the status without +short, ask the authoritative server, and check a cached name error before you add the record.Read article
- TroubleshootingCertbot "DNS problem: NXDOMAIN looking up A for": the name Let's Encrypt cannot findCertbot says DNS problem: NXDOMAIN looking up A for a name. Check spelling, A and AAAA records, delegation and CNAME targets, then retest with a dry run.Read article
- TroubleshootingDNS Changed but Users Still Reach the Old ApplicationDistinguish authoritative DNS, resolver caches and existing connections so an application migration has a measurable cutover and return plan.Read article
Risks and limits
- NODATA is not a status word dig is required to print. You infer it from NOERROR and no relevant answers, which is how RFC 2308 defines it.
- A referral is also NOERROR with no answer. The SOA in the authority section, or the lack of NS records there, is the distinction RFC 2308 draws.
- The negative TTL is the lesser of the SOA MINIMUM and the SOA record's TTL, not the MINIMUM alone.
Sources
- RFC 2308: Negative Caching of DNS Queries (DNS NCACHE) — IETF, March 1998, accessed 22 November 2026
- RFC 1035: Domain Names - Implementation and Specification — IETF, November 1987, accessed 22 November 2026
- BIND 9 manual pages: dig — ISC, BIND 9.20.22 manual, no date shown, accessed 22 November 2026
This article was originally published on .