Decode escapes before comparing labels
02Dots 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.
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 ↗
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.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
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.
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 ↗