12
4
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?
1
Nice! Side note: the fact that two websites share an IP address does not necessarily mean they are always hosted on the same machine. A load balancer might in fact also peek into these headers and delegate to different machines. (For Super User et al see also Stack Overflow’s New York Data Center, which I did not really read myself though...)
– Arjan – 2011-01-17T15:56:27.290@Arjan +1 good point... I mentioned load balancers, but it could obviously just be the IP(s) of a load balancer(s), and then they split the requests to many servers. – William Hilsum – 2011-01-17T15:59:24.573
1Marked as answer for the detailed info and links to further researched. Thanks! – Joshua Frank – 2011-01-20T14:42:07.303