views:

36

answers:

2

When one registers for a blog in blogger.com, a sub-domain gets created i.e. your_blog_name.blogger.com My question is - Is there no limit to the number of sub-domains you can create with a single domain name?

I am just curious as to how blogger (or any other blog hosting platform) does this?

A: 

There are restrictions on the characters that can be used (actually, two separate sets of restrictions due to the way IDNs work). There are practical limitations in terms of length. Beyond that no. Indeed, it's not much different for the entity in charge of .blogger.com to create a subdomain of that than for the entity in charge of .com to do so, and there were 80,000,000 of those at the start of last year .

Jon Hanna
A: 

This can be done by a catch-all A record rule in your DNS server configuration. For example, in bind, you would use something like this:

*.example.com.  IN A    127.0.0.1

This would make anything.example.com resolve to 127.0.0.1. Then, using an appopriate VHost on your http server, you can redirect all requests to a particular server-side script (for example PHP), which can then detect the hostname that was used, and respond with the content required.

dionyziz