Practical guide
How to use the DIG tool
dig is the standard DNS troubleshooting tool because it shows the actual DNS response — not a polished summary. This page runs the same query against a public resolver and gives you the full answer to read or share.
What this tool checks
DIG sends a single DNS query to a recursive resolver and returns the full response: header flags, the question section, the answer, any authority and additional records, and a TTL for each row. Unlike a plain lookup, it shows you exactly what came back on the wire, which is what you need when something is wrong.
When to use it
Use DIG when a lookup looks fine but mail still bounces, when DNSSEC validation fails, when you need to read TTLs before a cutover, when a resolver returns a different answer than expected, or when you want a clean output to paste into a ticket. It shows the full wire response — header flags, response codes, sections, and per-record TTLs — for any of the supported types, including SOA and large TXT bundles.
How to read the result
The header line shows the status (NOERROR, NXDOMAIN, SERVFAIL, REFUSED) and the flags (qr, aa, rd, ra, ad). The ANSWER SECTION holds the records the resolver returned. The TTL column is in seconds. The AUTHORITY and ADDITIONAL sections are not always present but show the nameservers and glue records the resolver used. If the answer is empty but the status is NOERROR, the record type does not exist for that name.
Common errors and what they mean
NXDOMAIN means the resolver was authoritatively told the name does not exist. SERVFAIL almost always points to a broken DNSSEC chain or an unreachable authoritative server. A correct NOERROR with zero answers means the record type is missing for an existing name. If the AD flag is missing on a domain you expect to be signed, DNSSEC validation is failing somewhere upstream.
DIG status codes and header flags
The header line is the first thing to read. These are the values you will see most often and what each one tells you.
| Field | Value | Meaning |
|---|---|---|
| status | NOERROR | Query succeeded (the answer set may still be empty) |
| status | NXDOMAIN | The name does not exist |
| status | SERVFAIL | Resolver could not complete — often DNSSEC or an unreachable authority |
| status | REFUSED | The resolver will not answer this query from your network |
| flag | aa | Authoritative answer — came straight from the authoritative nameserver |
| flag | rd / ra | Recursion desired / recursion available |
| flag | ad | Authenticated data — DNSSEC validation succeeded |
Field notes
When an answer looks wrong, check the status and the aa flag before anything else — a cached NOERROR with no records sends more people down the wrong path than any other DNS result. If you expect a signed zone, confirm the ad flag is present; its absence is usually the first visible sign that DNSSEC validation is breaking upstream rather than at the authoritative server.
Example DIG query
- Example input
dig example.com A @1.1.1.1- Example result
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12345 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1 ;; ANSWER SECTION: example.com. 3600 IN A 93.184.216.34
Status NOERROR plus a populated ANSWER section is the success case. The TTL (3600) tells you how long Cloudflare will cache this answer before re-asking the authoritative servers.
Related tools
Related guides
Reading A Full dig +trace Response
Follow a trace from the root servers to your authoritative nameservers, and spot delegation problems a normal lookup hides.
Read guidenslookup vs dig
When to reach for dig's full packet output versus nslookup's quick summary.
Read guideDNS Records Explained
What A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, and CAA records are for, and how to read them in dig output.
Read guideDNS TTL Explained
How to read the TTL column and how to pick a value that ages well during a migration.
Read guideNXDOMAIN vs SERVFAIL
Two DNS error codes that look similar but mean very different things. Decode them from dig's status field.
Read guideFAQ
What is the difference between dig and nslookup?
How do I read the status field in a dig answer?
What does the TTL column mean?
Why does this tool show different answers than my command-line dig?
Can I query DNSSEC records with this tool?
How do I query a specific record type with the DIG tool?
What is the difference between the ANSWER, AUTHORITY, and ADDITIONAL sections?
Last reviewed: 2026-06-25.