Visual RFC.
ALL RFCs / RFC 4343
Read the RFC ↗

RFC 4343 / START HERE

DNS case comparison, before the details

DNS means Domain Name System. A domain name contains labels, such as Lab and Example in Lab.Example. ASCII is a basic character encoding. Its letter pairs, such as L and l, match during DNS name lookup.

RFC 4343 clarifies exactly which name bytes compare as equal, how written escapes become label data, and why matching names can be displayed with different capitalization. It distinguishes name comparison from stored spelling.

The idea in one picture

  1. Read the label bytes

  2. Match ASCII letter pairs

  3. Keep other contexts separate

A simplified picture of the idea; the chapters explain the actual mechanisms.

Why it exists

A broad lowercase operation can change bytes that DNS does not treat as equivalent. Confusing a separator dot with an escaped dot can also change the name. Precise rules prevent a lookup or application from comparing the wrong thing.

A familiar example

A fictional lookup for LaB.Example. finds the same DNS name as lab.example. But lab.example. and lax.example. remain different. These matching rules do not authenticate a server or tell an application to ignore case in passwords.

Helpful background

You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.

What you’ll learn next

Begin with chapter one, or choose a topic.

  1. Match ASCII letters without folding every byteDNS, the Domain Name System, compares ordinary name labels without distinguishing uppercase and lowercase ASCII letters. ASCII is a basic character encoding. A label is one component of a name, such as Lab in Lab.Example.
  2. Decode escapes before comparing labelsDots 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.
  3. Separate lookup equality from stored spellingNames that compare equal can arrive with different capitalization. Input case and output case are separate from the question of which records the lookup finds.
  4. Resolve compression before applying the name ruleA DNS message can shorten a name by pointing to an earlier occurrence. A case-insensitive name match can reuse earlier label bytes whose capitalization differs from the name being written.
  5. Keep internationalization and application identity separateInternationalized Domain Names in Applications (IDNA) connects permitted Unicode labels and their ASCII-compatible DNS representation. That application-level work differs from the DNS byte-comparison rule.
Start with chapter one →

This introduction explains RFC 4343 (2006). Read the original RFC ↗