How is a subdomain passed to the webserver?

Posted by Joshua Frank on Super User See other posts from Super User or by Joshua Frank
Published on 2011-01-17T15:21:43Z Indexed on 2011/01/17 15:55 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

I know that dns resolves an address like example.com to an IP address like 11.22.33.44, but I'm a little confused about how subdomains are resolved, so that when you type http://subdomain.example.com, what actually gets passed to the server at 11.22.33.44? In other words, example.com = 11.22.33.44, but subdomain.example.com/path = ???

Are "subdomain" and "path" passed as http headers, or mapped in the url in some way, or what?

Thanks in advance.

Edit: If I'm understanding correctly, BloodPhilia says that subdomain.example.com actually is a different domain that in principle could resolve to a totally different IP. But if that's so, then what about hosts that have huge numbers of (what look like) subdomains, but which actually map to some path on the site. For instance, blogspot hosts millions of blogs, and they all look like this:

aaa.blogspot.com
bbb.blogspot.com
...millions more...
yyy.blogspot.com
zzz.blogspot.com

Those are clearly not subdomains with their own IP's, but rather some mapping like aaa.blogspot.com --> www.blogspot.com/aaa, but how is this accomplished? What actually gets passed to the web server at blogspot.com?

© Super User or respective owner

Related posts about dns

Related posts about http