Pcornel
Networking · Network & Protocols › DNS Protocol Reference

DNS Header Field Reference

Cheat sheet · https://pcornel.dk/topic.php?topic=277

Back to the Topic

Answer

Every DNS message starts with a 12-byte header: an ID that ties answer to question, one-bit flags (authoritative, truncated, recursion desired/available, authentic data), a result code, and the counts of records in each section.

Remember

Three results are often confused: NOERROR with answers is success; NOERROR with zero answers means the name exists but has no record of that type; NXDOMAIN means the name does not exist at all. SERVFAIL means the resolver could not find out. aa marks an answer from the zone's own server.

First checks

  • dig <name> <type> — the header line: status, flags, and the four counts.
  • dig <name> <type> @<server> — test one server.
  • dig <name> <type> +norecurse @<authoritative server> — expect the aa flag.
  • Capture filter dns — match query and response by ID.

Commands

dig

Verify in this order

query sent with an ID → response with the same ID → status NOERROR → answer count above zero → flags show who answered (aa, or rd ra from a resolver)

Where it usually breaks

local configuration → reachability/transport → request/negotiation → server or policy decision → response/state installation → client-visible result

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=277

Confirmation

Confirm action

Continue?