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

How does a name become bytes?

02

Count each name piece, pack an address or mail destination, and repair a piece or fact that does not fit.

RFC 1035 · § 3.1EXAMPLE
1 / 4 · Send a name and one fact as numbers

Dots help people read names; the wire uses counted pieces.

Turn a readable name into a counted strip

www.example.org.
Count the ASCII characters in each piece

A person sees dots. The receiver needs to know where each piece ends.

What happens if you change this?

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

3 / 3
03
Attach typed record fields and their data.

Attach typed record fields and their data.

How does a name become bytes?Count each name piece, pack an address or mail destination, and repair a piece or fact that does not fit.www.example.org.3www7example3org0length / label · length / label · rootTYPE / CLASS / TTL / RDLENGTHRDATAEncoded names are bounded; labels are not dot-separated on wire

Key idea: A name uses counted pieces; each record adds a type, class, reuse time and a counted data field.

Terms
label
One name piece, such as www; its count is in bytes.
RDATA
The fact’s data: four bytes for this Internet address, a preference and name for mail.
RDLENGTH
How many bytes the fact’s data occupies.
TTL
How many seconds a saved answer may ordinarily be reused.

Look up a term in the glossary ↗

Rules & examples

Name counts and record data lengths have different jobs.

These reference examples may differ from the selected experiment.

  • An ordinary label is at most 63 octets; the full encoded name is at most 255.
  • Resource records add TYPE, CLASS, TTL, RDLENGTH, and type-specific RDATA.

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

Uncompressed ASCII names only: length byte, label bytes, then zero; maximum label63 bytes and expanded name255 bytes. This fixture includes the root as a syntactically valid name, without claiming it has an A or MX record. NAME is followed by TYPE2, CLASS2 (IN=1), TTL4 (60seconds), RDLENGTH2 and RDATA. A=1 has four address bytes. MX=15 has a two-byte preference10 plus an uncompressed mail.example.org. No lookup or existence claim is made. TTL follows the unsigned-field erratum and RFC2181 constraints; all selected TTLs are60.

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 ↗