UnixSage

Maximum Domain Length

RFC 883 (http://ietf.org/rfc/rfc0883.txt) States:

Domain names messages are expressed in terms of a sequence of labels. Each label is represented as a one octet length field followed by that number of octets. Since every domain name ends with the null label of the root, a compressed domain name is terminated by a length byte of zero. The high order two bits of the length field must be zero, and the remaining six bits of the length field limit the label to 63 octets or less.

To simplify implementations, the total length of label octets and label length octets that make up a domain name is restricted to 255 octets or less. Since the trailing root label and its dot are not printed, printed domain names are 254 octets or less.

In the domain “yahoo.com” There are 2 labels “yahoo” and “com” no single label can exceed 63 characters. The ‘.’ is not part of the label character count, it is however part of the total character count which must not exceed 253 bytes there is a unwritten ‘.’ at the end of every domain name so that is why the 253 bytes. There is not a limit to subdomains as long as the total amount is less than 253 bytes.