A Beginners Guide to DNS (Domain Name System)
posted by
Adam
-
12:41 25/10/11
What is DNS?
Before I answer this question, it’s useful to understand how computers can be identified when connected together over a network. There are literally millions of networks in the world, with the most famous being the Internet. A network is loosely defined as a collection of computers who are connected to each other and can communicate with each other. Traditionally, this was done solely through wires made of copper or of fibre (glass) but today this encompasses many wireless technologies as well, such as your home wireless router and even through your mobile network provider.
The issue as to how to communicate with each individual computer came about on the back of this – how do you know where to send the information for it to reach the correct computer?
Although in theory you can just broadcast your message to everyone (and this does happen to some degree in the vast majority of networks), when you literally have billions of devices connected to each other it can become very difficult to get your message across – think if you have one thousand people standing in a big room and all shouting messages to each other, then make that 1 million times louder and I’m sure you’ll get the picture! So a method of uniquely identifying each device on a network had to be invented and as computers really only understand binary information, that method had to be number based.
The IP (Internet Protocol) addressing system was invented to solve this problem
There are currently two active versions of this system – IPv4 and IPv6. You may have heard the term IP Address before, it’s the unique number assigned to a particular device on a network. IPv4 is the most common system, although the world is currently transitioning to the IPv6 standard as we are literally running out of numbers in the IPv4 spectrum. They both work in the same way, the main difference being that IPv6 has a much higher address capacity.
An IPv4 address looks like this where each x can be a number between 0 and 9:
xxx.xxx.xxx.xxx
For example, a lot of home routers have this IP address by default:
192.168.1.1
This can also be expressed like this, but usual isn’t as it makes it easier to read if formatted as above:
192.168.001.001
So, the next device on your home network might be:
192.168.1.2 and then 192.168.1.3 and so on.
So now we can uniquely identify each computer by number but can you see the problem?
The problem is that these numbers are difficult to remember so the DNS system was invented to make the name of each individual computer easier to recall. Some of the more famous DNS names are www.google.com, www.microsoft.com, www.ebay.co.uk and www.hmrc.gov.uk.
All these names have to be stored somewhere
For this purpose DNS Servers have been set up to store the information. They are setup in a pyramid like structure across the world, with all the domain names being controlled by 13 root servers. If you look at the image below, I’ve mocked up a very simple DNS hierarchy.

At the top you have the root servers and then underneath those you have the second tier which is then connected to the third tier and so on. It’s important to note that each tier only has access to the tier directly above and that it can answer requests only for the tier directly below. For example, the second tier has no direct contact with the eighth tier.
When you register a domain name or change the IP address of the device that is, for example, hosting your website (e.g. if you wanted to move your website to a faster server), then you would alter the record on the DNS server that you have access to. If we look at the image again, we can assume that our domain name example.com is hosted on the server circled in red on tier 4 of the system.
For us to inform the rest of the world what the new address is, that information has to pass up through each individual tier until it reaches the root servers. Once the root servers have been informed, the information is then cascaded down through each individual tier until every DNS server has been informed of the changes.
So why does my IP address change not get recognised immediately?
Root servers are updated every hour so it can take up to an hour to inform a root server of any IP address change. This information is then cascaded down through literally thousands of other servers which all have different update cycles (it depends on the organisation running each server). Some may be in real time, others might be set to once every 3 days.
As a general rule from my own firsthand experience, IP address changes are generally completed within an hour but I’ve seen some take up to 3 or 4 hours. One final caveat to be aware of is that some DNS servers and indeed some operating systems are set to cache (store) DNS information to speed up the connection between the machines.
One last thing to be aware of
An IP address can have more than one more domain name associated with it, and a single device can have more than 1 IP address assigned to it. One of the reasons for this is that although it's possible to host 2 or more websites on the same IP address, it's not possible to have more than one SSL certificate (i.e. security certificate) active on an IP address. Therefore you would have one secure website respond on one IP address and the other secure website respond on a different IP address.
I do hope you find this post useful but should you have any questions, want further clarification or would like to suggest a topic for an upcoming blog please post a comment!