number of characters in a domain?

William Herrin bill at herrin.us
Sat Jul 23 16:36:10 UTC 2016


On Sat, Jul 23, 2016 at 11:07 AM, Jimmy Hess <mysidia at gmail.com> wrote:
> 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


-- 
William Herrin ................ herrin at dirtside.com  bill at herrin.us
Owner, Dirtside Systems ......... Web: <http://www.dirtside.com/>



More information about the NANOG mailing list