Moving a domain to a different server (1/3)
February 21st, 2007 by Joost SchrierSometimes we get a little carried away when writing about something we feel strongly about. As a web developer I can ramble on for hours about how to best set up a PHP application and Oscar will defend a design he loves till death. The article I just finished writing is one of those articles that you want to keep short, but becomes too long because there is so much you want to convey. For this reason we will split it in three parts and post the parts separately. This is installment no. 1, the basic explanation of the setup of a domain and its hosting.
When talking about a website and domain names you have to make a distinction between several levels, namely:
- Registrar level
- Nameserver level
- Webserver level
Registrar level
When you want to register a domain name you start at the registrar. Some examples of registrars are Networksolutions (expensive and very customer-oriented), 000domains (mid-level price with excellent back-office) or DomainsAreFree (very cheap, but matching service). There are probably already more than a million registrars so deciding with which to go is like deciding which breath of air to take, all of them are roughly the same; the difference is in the details. My advice: ask around who uses which.
It is a registrar’s job to allow you to register a domain name with them, register this name with the ‘root’ database of domain names and protect the domain name’s integrity and ownership. In the end this means that when you register a domain name with a registrar they will take care of the rest (in exchange for a fee, of course).
For the scope of this document, the most important job of the registrar is the registration with the ‘root’ database of domain names (also known as the WHOIS database). This ‘root’ database is a giant database, located in several highly protected databases, which holds a lot of information about all domain names. This information consists mainly of information about the owner of a domain name, its administrative and technical contacts and, very important, its associated nameservers.
When a browser (Internet Explorer, Firefox and such) requests a domain name, for instance www.eureka.an, a signal is sent out to retrieve the nameservers associated with the domain name. The WHOIS database returns this information to the browser.
Nameserver level
If you are looking for information about this subject you probably know that domain names eventually stand for an IP-address. Because people seem to have some problems with remembering numbers ‘they’ decided to use names instead. Today the names also allow us to have more domain names than there are IP-addresses, but more about that later.
A nameserver is basically just a device that points requests in the right direction. The nameservers for www.dgfmedia.net are a.ns.interland.net and b.ns.interland.net. When the browser in the above example has heard from the WHOIS database that it should go and ask for the website at the nameserver a.ns.interland.net it does exactly that. The nameserver then tells the browser to go and look for the website at a server at the IP-address 66.36.110.64.
In this case the browser is told to go to 66.36.110.64 because the browser asks for the A-record of www.dgfmedia.net. An e-mail on the other hand is not supposed to go to this IP-address. When an e-mail is sent to someone@dgfmedia.net the mailserver asks for the MX-records for the domain. The nameserver then returns inbound.registeredsite.com (IP-address: 64.224.219.122) because that is the server that handles our e-mail.
So, what a nameserver does is just pointing different kinds of requests in different directions.
Webserver level
A website is just a bunch of files which are served to a browser by a webserver. This makes the primary job of a webserver showing you the files of a website based on your request for that website.
If you look at the internal structure of a typical Linux or Windows server you will see that it is basically the same as your home computer. The big difference is that a webserver runs webserver software (Internet Information Services on Windows, or Apache or similar software on a Linux server) which allows that computer to show you the files of a website. It is this piece of software that makes a webserver a webserver.
When a request for the website on www.dgfmedia.net comes in at the Apache webserver on 66.36.110.64 the server looks in its internal files if it actually has a record for www.dgfmedia.net. If it does, which it obviously does, it looks in which directory the files of the website are stored and it then shows you the files within that directory.
You can bypass all this questioning and redirectioning by just typing the IP-address in the address bar of the browser and you will see the website of Dragonfly Media. The reason for this is that there is only one website on this IP-address.
Earlier on I said that it is possible to have more domain names than IP-addresses. When you request a website the request is sent to the webserver and the webserver is also told that you are looking for www.dgfmedia.net. If there are more websites on that specific IP-address it shows you the one for www.dgfmedia.net because that is the one you requested. This is called virtual hosting or shared hosting.
A good example is the website on www.upgrade-international.com. When you type in this domain name in your browser you will get their website. This website however, is hosted within a shared hosting account so if you type in the IP-address of the webserver (85.92.141.52) you will not see the website, but the generic welcome page for the Apache webserver. This type of hosting is what enables the fact that there are more domain names than there are IP-addresses.
When you put everything together you see that there a lot of aspects to take into account when you build a website. It is not just building a good looking website and adding useful interaction (which have all kinds of pitfalls of their own), it is also about setting up a domain name that follows the basic structures of the internet.
To put this into perspective: when you buy hosting for your website you can usually also register a domain name with the hosting provider and everything is taken care of without you having to worry about how everything works. You only need the cavalry when you want to do something that is different from the basic setup.









