Published on

Domain Name Length Limits

Authors
  • avatar
    Name
    hwahyeon
    Twitter

According to the DNS standard (RFC 1035), domain names have strict length rules:

PartLimitNotes
Entire domain nameUp to 253 charsIncludes dots (.). Theoretical maximum is 255 bytes, but only 253 characters can be used safely.
Each labelUp to 63 charsA label is each part separated by dots, e.g., www, example, com.

Why 253 and not 255?

  • RFC 1035 defines the maximum domain name length as 255 bytes.
  • However, this includes:
    • 1 byte for the length field of each label
    • 1 byte for the null terminator at the end
  • This leaves 253 characters for the actual domain name.

Implication

  • In theory, the number of subdomains is almost unlimited.
  • The practical limit comes from the total domain length (253 chars).
  • Example: a.b.c.d.e.f...example.com is valid as long as no label exceeds 63 chars and the whole stays under 253 chars.