Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a limit for number of subdomains like "*.domain.com"?

share|improve this question

migrated from stackoverflow.com Sep 16 '09 at 14:39

This question came from our site for professional and enthusiast programmers.

    
The only limit is when your name server runs out of memory. It's the same as the limit for the number of subdomains like *.com: 253 characters, total. –  derobert Sep 15 '09 at 7:01
    
Are you asking about no of subdomains that can be created for particular domain ? –  Mahin Sep 15 '09 at 7:01
    
ops.ietf.org/lists/namedroppers/namedroppers.2003/msg00964.html if you want a reference –  derobert Sep 15 '09 at 7:03

2 Answers 2

The only limit is the length of the URL - the subdomains are interpreted by the webserver. (And that means there's no relevant limit, by the way - the number is just too huge.)

EDIT: the maximum length of the URL is 253 octets, or 253 characters if using ascii. That's plenty :)

share|improve this answer
    
then what's the limit of the length of the URL? –  Shore Sep 15 '09 at 6:58
    
It's starting to sound like Homework, some random trivia question thrown by a bored prof. –  Jon Limjap Sep 15 '09 at 7:03
    
It is a DNS limitation. vhosts are not relevant to his question. –  Yannick Motton Sep 15 '09 at 7:04
    
Depends on your browser, the server, etc. IE has a limit of 2083 characters in the URL, afair. RFC 2616 advises not to rely on URIs above the length of 255 characters. –  Joey Sep 15 '09 at 7:06
    
But there is no limit for the URL... The standard, RFC 2616, says "The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. [...] Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths." –  bortzmeyer Sep 17 '09 at 9:35

The limit would be dependant upon the DNS server, not the webserver. BIND allows for 16777216. Microsoft DNS is said to be stable to 20K objects per zone. Regardless, Peter is correct. It is too large to matter unless you are doing something non-standard.

To clarify, the longest domain name possible is 255 characters with no label (peice between dots) to be longer than 63 characters per DNS spec.

share|improve this answer
2  
You can easily do *.domain.com IN A 10.11.12.13 and then the limit is on the webserver. If you're going to have millions, this is probably the only sane way (e.g., think of a site that lets you set up blogname.site.come, for example) –  derobert Sep 15 '09 at 7:06
    
In that event, I would argue that the issue would still not lie with the web server. If the server were serving static content, perhaps there could be an issue, but in all likelihood, with that many domains, the script running on the server could just examine the request string and parse out the relevant portion of the domain to determine the content to show. –  Mitch Aug 21 '12 at 2:13

Your Answer

 
discard

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