Visual RFC.
ALL RFCs / RFC 4343
Read the RFC ↗
RFC 4343 / DNS NAME COMPARISON

Decode escapes before comparing labels

02

Dots normally separate labels in written DNS names. A backslash escape can instead put a dot, a backslash, a zero byte or another value inside a single label.

RFC 4343 · § 2.1EXAMPLE
4 / 4
Decode escapes before comparing labelsFour separate name-token examples: escaped a-dot-b is one label before example; unescaped a.b has two labels before example and differs; decimal escape065followed1produces A1 while short65is not defined; published a-zero-backslash-255-z is five counted data bytes, so embedded zero is not a root label. Isolated absolute token parser only.Zero data inside a counted labelWritten: a\000\\\255z.example.First label length: 5length counts the zero byte tooData bytes: 61 00 5c ff 7aRoot: separate zero-length labelAll 256 data-octet values are possible
04
Retain embedded zero and high bytes.

The published a\000\\\255z.example. example has five bytes in its first label: 97,0,92,255,122. Length5 keeps the embedded zero inside the label; the root is a separate zero-length label.

Source for this drawing: RFC 4343 · Read RFC section 2.1 ↗

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.

KEY POINT

Written separators and escaped data octets have different jobs.

  • A literal dot inside a label can be written as \. or \046. A backslash can be written as \\ or \092. Nonprinting octets use a backslash and exactly three decimal digits in the convention described here.
  • A backslash followed by one or two decimal digits is not defined. Four decimal digits consume the first three as an octet, then leave the fourth as a separate character: \0651 represents A followed by 1.
  • Labels can contain arbitrary eight-bit values, not only printable host-name characters. Their wire lengths and label boundaries still matter. A zero data byte within a counted label is not a root label.
  • The examples use isolated absolute name tokens. The bounded teaching parser is not a complete zone-file parser, shell unescaper, Unicode converter or extended-label implementation.
DETAILS

Verified editorial erratum 2647 removes an extra word in the dot-escape sentence; the valid forms remain \. and \046. Undefined short decimal escapes are rejected by this local teaching parser, not turned into a new RFC MUST-discard rule.

Read the RFC section ↗

All chapters in RFC 4343

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 ↗