Lesson 3 of 9 · 25m
Reading dig Output Like an Operator
Use dig flags, response sections, status codes, and trace output to isolate DNS failure layers quickly.
dig is not a command you run once during an outage. It is a microscope. Most people look only at the ANSWER section, which is why they miss the difference between “name does not exist,” “server failed,” “DNSSEC validation failed,” and “your recursive resolver is lying to you because it has a stale cache.”
Start with the shortest useful output
dig sudosecurity.org A +noall +answerThat is good for a clean answer, but during debugging you want the question, status, flags, and server:
dig sudosecurity.org A @1.1.1.1Read these fields in order:
status: NOERROR protocol-level answer arrived
flags: qr rd ra ad response, recursion desired/available, authenticated data
SERVER: 1.1.1.1#53 who answered
ANSWER: 1 records suppliedstatus describes the response, not whether the application likes the answer. NOERROR with the wrong address is still wrong operationally.
Know the statuses that matter
NOERRORmeans a response arrived and content still needs inspection;NXDOMAINmeans the name itself does not exist according to the authority.SERVFAIL: failure in recursion, validation, upstream communication, or server logic.REFUSED: the server refuses your query, often policy or recursion restrictions.NOTAUTH: the server is not authoritative for that zone.
A SERVFAIL from 1.1.1.1 and a valid direct authoritative answer often points toward DNSSEC validation. The same SERVFAIL from every resolver can still be authoritative-side breakage, especially when signatures expired or delegation data is inconsistent.
Use +norecurse and +trace for different jobs
dig www.sudosecurity.org A @ella.ns.cloudflare.com +norecurse
dig www.sudosecurity.org A +trace+norecurse asks a specific server what it can answer directly. +trace makes dig perform iterative resolution itself, bypassing your normal recursive path. Trace output shows the delegation chain: root, TLD, domain authority, and final answer. If trace succeeds while normal recursion fails, suspect the resolver path. If trace fails at a particular delegation, focus there.
TCP and buffer size are not edge cases
DNS starts over UDP, but large DNSSEC responses, truncated answers, and some firewall mistakes push you into TCP:
dig sudosecurity.org DNSKEY @1.1.1.1 +tcp
dig sudosecurity.org DNSKEY @1.1.1.1 +bufsize=1232If UDP is truncated or fragmented badly, the tc flag appears and resolution should retry over TCP. Networks that block TCP/53 are broken DNS networks even if small queries seem fine.
Field notes
- Add
+time=2 +tries=1during outages so slow defaults do not hide timeouts. +shortis for scripts, not diagnosis; it throws away precisely the evidence you need.- The
ADbit depends on resolver validation and client trust context; do not treat it as a universal authenticity stamp. - Capture exact commands and timestamps. DNS is time-dependent because caches expire, so memory-based incident reconstruction is unreliable.
Was this lesson helpful?