Measure a DNS Hostname After IDNA Encoding
Admin ·
Count what DNS will store. A human-readable internationalized label can be shorter than its ASCII representation. Presentation characters also account for separators differently from an uncompressed DNS name.
Count the encoded bücher label and terminal root
Choose Internationalized hostname. The first label bücher is encoded as xn--bcher-kva. Count 13 octets for that label and 7 for example. The report retains the explicit terminal root dot.
The ASCII name without the terminal dot is 21 characters. On the wire the two label lengths take one octet each, and the root takes one more. The resulting uncompressed name uses 23 octets. Remove the dot to confirm that the same wire length is reported.
| Field | Expected result |
|---|---|
| ASCII hostname | xn--bcher-kva.example. |
| ASCII presentation length | 21 characters |
| Uncompressed wire length | 23 octets |
Open DNS Name Length CheckerRFC 1035 DNS size and name encodingUnicode IDNA compatibility processing
Test the complete name and the per-label limit
Choose 255-octet wire name. The ASCII presentation is 253 characters, including internal dots. Every label fits within 63 octets.
Choose 256-octet wire name. That extra octet exceeds the total budget even though each label fits individually. The 64-octet label example shows the separate length failure on the first label.
Open DNS Name Length CheckerRFC 1035 DNS size and name encoding
Keep hostname syntax separate from the byte budget
The underscore and leading hyphen examples identify problems with an ordinary hostname. Some protocol owner names, including SRV service labels, use an underscore by design.
A DNS message can compress a repeated suffix with a pointer. This tool counts the uncompressed name and leaves DNS message compression and lookup to separate tools.
RFC 1035 DNS size and name encodingRFC 1123 host name syntaxRFC 2782 service labels
Common questions
What if I enter only a dot?
The root uses one zero octet on the wire and has no ordinary hostname label.
Why is a count unavailable for an invalid label?
The tool needs an encodable label to calculate the ASCII and wire lengths. Fix the marked label before relying on the total.