If you know something about domains, you might have seen the letters DNS floating around. Whether in discussion, or in the settings of your website or domain provider, DNS is an integral part of how the internet functions.
What does DNS stand for?
DNS stands for domain name system. In short, DNS is a system which translates domain names – the memorable, human-friendly addresses we type into the search bar – to computer-friendly, numerical (or alpha-numerical) IP addresses.
DNS is often referred to as a phone book for the internet, as it links a domain’s IP to the domain being searched for – much like linking a phone number to a person’s name. In simple terms, each time a request is made for a specific domain, the DNS looks it up and tells the browser which IP that domain name points to.
But it isn’t quite as simple as that, mainly due to the sheer number of IP addresses and domain names out there.
In 1983, Paul Mockapetris invented the domain name system. Prior to this, the internet was still in its infancy, and primarily used in an academic capacity. It was essentially limited by the scope of human memory – each separate web page was defined by a 32-bit long IPv4 address, such as 172.16.254.1. Therefore, remembering more than a few addresses was difficult.
Once DNS was implemented, it opened up the internet in a way that was just not possible before. Some of you might be able to rattle off a couple of IP addresses, but chances are you can remember far more domain names – especially those for the most popular websites.
How does DNS work?
The system goes through a number of steps to reach the objective of translating a domain to its IP address. Here’s what it does:
Step 1: The user requests the information
This happens whenever you click a link or enter a URL into your browser, among other things. It’s the browser which makes this initial request. First, it will check its local DNS cache. If you’ve visited a site before recently, its translated address will be stored in the cache so it can be easily found again.
If the address is not in the cache, meaning it hasn’t been visited before or not in a while, the request moves to the next step.
Step 2: Recursive DNS servers
The request will be sent up the chain to recursive DNS servers (also known as resolvers). These are provided by the users internet service provider, but can also be operated by third party providers such as Google. These have their own caches, and as other users use the same resolvers, popular websites are likely to be stored in this cache.
If the address is found in the recursive DNS servers, the request will be returned to the browser and it will end there. But if it isn’t, it goes even further afield.
Step 3: Root name servers and TLD name servers
The recursive server will query a root name server, which essentially is able to answer questions about domain names. This type of server won’t store any IP addresses itself, but acts as a switchboard – they direct the query to the TLD name servers.
In this case, TLD stands for top-level domain – also known as a domain extension. A TLD name server will contain information for a specific TLD, such as .com, .co.uk, or .net. For instance, if example.com was what the user queried, the request would be directed to a TLD name server for .com domains.
The TLD name server can then direct the request on to the server which stores the IP address for example.com specifically.
Step 4: Authoritative DNS servers
The TLD name server will look at the “example” part of the example.com request, and direct the query to the relevant authoritative DNS server. These are what hold the actual “translations” to the original request. The recursive server – the second step in the process – will retrieve the result of the query and store it in its own cache. If another query comes through for the same domain, the recursive server can now serve the request without having to go through the query process again.
Step 5: Receiving the result
The recursive server will return the answer of the query back to the computer that asked it. In the case of a normal user browsing on their personal computer, the operating system of the computer will then let the browser know what IP address the domain points to – which it can then load.
While there are lots of steps to this process, you wouldn’t notice as you use the internet – as it takes milliseconds to complete each request.
Take a look at our series of blog posts from one of our developers to find out more about how the internet works.