Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there a maximum allowed subdomain depth supported by webservers or browsers?

For example, could a domain like cause problems?

share|improve this question

2 Answers 2

I believe the DNS itself can have up to 127 levels of label, each label can be up to 63 characters and the maximum length of the whole record is limited to 253 characters as you have to encode the length and a terminating 0.

share|improve this answer
The 127 levels is just a consequence of the 255 character limit (which includes the length and a trailing dot, but not a terminating 0). – Chris S Mar 6 '14 at 14:52
wikipedia also mentiones the 127 level limit. regarding webservers and browsers they must be analyzed and tested individually – weberik Mar 6 '14 at 17:58
With the caveat that just using the IP address becomes easier to remember if the name gets too long and ridiculously convoluted, so there's a practical user-patience-for-nonsense limit. – milli Mar 8 '14 at 20:45
@milli Well, that depends on the domain. A random 32-bit number, to me, is harder to remember than Because I don't know how your memory works, but mine's definitely a graph database. – Parthian Shot Aug 1 '14 at 14:53

There is no defined maximum in terms of the number of dot-delimited subdomains, but DNS does limit the maximum overall length of a hostname (including the dots) to 255 characters.

share|improve this answer
Not part of the Q, but the length of each "label" is also limited, as Iain notes. – Chris S Mar 6 '14 at 14:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.