Visual RFC.
ALL RFCs / RFC 1035
Read the RFC ↗
RFC 1035 / DNS MESSAGES AND FILES

What is inside a DNS reply?

01

Open a reply like a packet with labeled compartments. Change its number or entry count and see why the receiver stops.

RFC 1035 · § 4.1.1EXAMPLE
1 / 4 · A helper is waiting for question 17

The bytes are a reply about www.example.org. What is inside?

A reply arrives for our waiting question

Waiting helperQuestion 17www.example.org. → address?
Incoming reply49 bytes00 11 81 80 00 01 00 01 00 00 00 00

Let’s open the reply before trusting what it says.

What happens if you change this?

Make one change, then watch again. Restart restores the original example.

3 / 3
03
Use each count to locate the following record sections.

Use each count to locate the following record sections.

What is inside a DNS reply?Open a reply like a packet with labeled compartments. Change its number or entry count and see why the receiver stops.ID / flags / QD / AN / NS / AR countsQuestion: name / type / classAnswer recordsAuthority recordsAdditional recordsHeader counts delimit sections; ID is not authentication

Key idea: A DNS reply carries an identifying number, section counts and typed facts; a count is not a byte length.

Terms
wire format
The exact byte arrangement the sender writes and the receiver reads.
DNS header
The first twelve bytes: a number, switches and four entry counts.
Question section
The name and kind of information being requested.
Authority section
Records naming a responsible keeper, not necessarily the answer.
transaction ID
A number copied into a reply to help match it to a waiting request.

Look up a term in the glossary ↗

Rules & examples

A header gives a reading guide; the receiver still checks the contents.

These reference examples may differ from the selected experiment.

  • Question, Answer, Authority, and Additional are distinct sections.
  • The ID helps correlate a response with its query; it is not cryptographic authentication.

The drawing is a simplified worked example. Follow the linked RFC and its updates for implementation requirements.

This fixed OPCODE=0, QR=1 reply has ID17 (or the deliberate wrong18), RD=1, RA=1, AA=0, TC=0, RCODE=0. QDCOUNT=1. A reply contains one A/IN answer or one NS/IN authority record; Additional is empty. The broken count says ANCOUNT=2 but supplies one. A real receiver also checks peer addresses, ports and question; an ID match alone neither authenticates data nor proves a reply safe. RFC9619 forbids QDCOUNT greater than1 for OPCODE=0. No general DNS parser or network exchange is simulated.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 1035

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗