c_pattle Posted April 2, 2011 Share Posted April 2, 2011 This could be a silly question and it may not be very relevant here, forgive me if that is the case. When you have a domain like http://example.com and you then have a sub domain like http://something.example.com how is that achieved? Is it to do with the way the site is coded or structured? Quote Link to comment Share on other sites More sharing options...
gizmola Posted April 2, 2011 Share Posted April 2, 2011 Domains are simply a function of the DNS system. The DNS system does one simple thing: turn domain names into IP addresses. So first and foremost a subdomain is defined in your DNS system. In DNS you have a zone file for every domain you own which defines the name to IP address conversion. With a domain you can define in your zone file any number of subdomains you want. In terms of websites, in the old days, webservers could only support one website per IP address combination. This was amended to support the addition of of an http host header in http 1.1 which facilitated the addition of vhost capabilities. In DNS you can have many different names all resolving to the same IP address. As IPv4 addresses have become a precious commodity, it has become common practice for people to host many different websites on the same server, with the same public IP address. This works, because browsers now send the http host header, and websites will read this header and determine which website to serve up for a given client request. In a nutshell, subdomains are entirely a DNS function, while websites are a function of the webserver. Quote Link to comment Share on other sites More sharing options...
c_pattle Posted April 2, 2011 Author Share Posted April 2, 2011 I understand it now, thanks for such a detailed response. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.