How does a name become bytes?
02Count each name piece, pack an address or mail destination, and repair a piece or fact that does not fit.
Dots help people read names; the wire uses counted pieces.
Turn a readable name into a counted strip
www.example.org.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.
Attach typed record fields and their data.
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.
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
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.