number of characters in a domain?

I was hoping someone can help me confirm my research. I am correct that domains are now limited to 67 characters in length including the extension?

Cheers
Ryan

I would consult RFC1035 for the label sizes, but the total length can include multiple labels up to 255 in length. Check section 2.3.4

Jared Mauch

a message of 12 lines which said:

I would consult RFC1035 for the label sizes, but the total length
can include multiple labels up to 255 in length. Check section 2.3.4

On another mailing list, Marc Blanchet noticed the limit in the RFC is
255 octets, not characters, which make a difference if you use IDN :slight_smile:

63 octets per label (the bits between the period separators) , 255 octets
per domain name. In ascii octets and characters are interchangeable, but as
Stephan noted, it gets slightly more complicated for IDN.

RFC1035; A hostname / FQDN cannot exceed 255 octets in totality.
This includes all the label-length fields, therefore, the limit
on total human-readable FQDN string is less.

(Subtract 1 Octets initially, then subtract more octets for every
DNS Path component added, including the Null label at the End of every FQDN.)

In addition, the string component of each DNS label is limited to 63 octets.

This is a hard limit in the DNS packet format. In the packet, the dots
are replaced by either:

1 byte whose high two bits are 0 and whose low six bits are the length
of the next label, 0 to 63. 0 means done, end of the name.

2 bytes, whose high two bits are 1 and whose low 14 bits are the byte
offset within the DNS packet where the name continues

So what happens is: if there are three names in the DNS packet:
www.example.com, ns1.example.com, and ns2.example.com, then the packet
will store www.example.com in full (with the dots replaced with the
next label length) and then it'll store ns1 followed by a pointer to
where "example.com" began in www.example.com and finally it'll store
ns2 followed by a pointer to where "example.com" began in
www.example.com.

Regards,
Bill Herrin

Not really ... the 1035 limits apply to the A-label

The number of wire octets is <= 255.
The number of presentation characters <= 1008 (63*4*3 + 62*4 + 4)