An overview of the DNS system
The Domain Name System (DNS) serves as a system to translate the name of a site to an IP address and vice versa. This means that if you buy a domain name such as www.example.com this will exist on an IP address, perhaps 111.222.121.131 but you can visit it by typing www.example.com into your web browser. This will point the browser to your web hosting account and people can then view your site.
The way that a standard DNS request works when someone types in your web domain is that your DNS server queries the domain authority for the DNS servers of your domain, (e.g. Nominet for uk domains) once it has found this out it queries this DNS server to find the IP address of the domain.
If you have heard of DNS propagation before you’ll probably know that this is associated with a period for which you might not be able to access your domain, this could happen if your site changes IP address for example moving from a shared hosting account to a reseller hosting account with a dedicated IP. The reason that this happens is due to DNS caching which many ISP’s employ. What this means is that if someone recently visited the site you are going to look at, your ISP’s DNS servers may have cached this IP, and instead of checking with the master authority they will just tell you the same IP that was correct the last time they checked. Usually DNS results are only cached for a few hours, but if the IP of a site has changed since they were last cached then this site may appear to be unavailable to you.
In addition to ISP caching, DNS can also be cached locally on your computer, if you are using windows there is a quick way to erase this cache, which can also be useful if you wish to change the DNS servers you are using as it will erase the results that the last server gave you. Here’s how to do this on the operating system of your choice:
Windows: Run the command “ipconfig /flushdns” via the Start -> Run menu.
Linux: Use the command “/etc/init.d/nscd restart” from the shell.
Mac OSX: Use the command “dnscacheutil -flushcache” or prior to 10.5.1 “lookupd -flushcache”
The DNS system stores other information also, and I will explain the Mail eXchanger record (MX record) which would be used if you wished your email hosting to be on a separate server to your web hosting, or you wanted some redundancy in your email hosting incase a server went down. An MX record consists of a priority and a hostname; a hostname should be used instead of an IP address to ensure that if the IP changes the MX record remains correct. The priority is used to indicate which mail server delivery should be attempted to first, the lower number indicates higher priority, generally numbering between 0 and 20 is used. If you wish to have a load balancing mail system due to high volumes of incoming mail, you can set the priority of the mail servers to the same value, which means that any of these servers would be used.