Looking for an easy to understand, jargon-free introduction to DNS? You’ve come to the right place!
Let’s jump straight in and answer your question: what is DNS? DNS stands for Domain Name System, and its main purpose is to translate domain names into IP addresses.
Okay, but why? Well, the web browsers and computers that make up the internet talk to each other, and are identified, using IP addresses. An IP address is a unique string of numbers that identifies every machine using the internet. Think of an IP address like a postal address – every device on the internet has one, and you need the address to find your location (such as a web page).
IP addresses are computer-friendly, but they’re not so helpful for humans. It’s hard enough to remember all our various passwords, let alone hundreds of different strings of numbers! That’s why we have domain names. Instead of searching 220.127.116.11, for example, you can search using a domain name, like www.websitebuilderexpert.com.
Domains are much easier to remember than IP addresses, and we can use domains thanks to DNS. This is because DNS takes our easy to remember domain name, and translates it into a string of numbers that our web browser can understand.
Without DNS, we would all have to remember IP addresses to navigate the internet – so really, DNS is pretty awesome!
Like what you see?
Please feel free to use any of the graphics you see in our article – you can find the fully combined infographic right here on this Google Drive. We just ask that you credit and link back to this page. Enjoy!
When you try to load a webpage using a domain name, you kickstart the DNS query – the process of taking a domain name and translating it into an IP address for your web browser.
This process is a team effort, made possible by four DNS servers working together to find the right IP address for your search. Introducing…
We’ll walk you through the process of exactly how these servers work together in just a minute, but first, let’s take a look at each one in turn.
Resolving Name Server
This is the workhorse of the DNS lookup – the resolving name server is the first server in the lookup process, and its job is to find and query each server in turn until it finds the correct IP address.
You can think of the resolving name server like a librarian finding the place for a book, or a postal worker delivering a letter. In both cases, you have to narrow down the final destination using a system – for example, by country, state, street, and name – until you have the right address!
The most important thing for a resolving name server to know is where to find the root name servers, which brings us nicely to…
Root Name Server
This is the first place the resolving name server comes looking for an IP address. The root name server is usually a point of reference – it tells the resolving name server where to look, giving it a more specific direction. In short, it can tell the resolving name server where to find the right TLD name server!
TLD Name Server
TLD stands for Top Level Domain, which is simply the name for the end of a domain – for example, .com is a TLD, as are .org, .net, and so on. If you’re looking for www.example.com, you’ll need a .com TLD name server.
When a domain gets purchased, the TLD registry updates the TLD name servers. This means the TLD name server knows which authoritative name server to go to.
Authoritative Name Server
This is the last server in the process. The authoritative name servers refer to the “example.com” part of the domain, and this is the server that can tell the resolving name server the exact IP address the browser should go to.
Okay, so you know what a DNS is, and you’ve met the four servers involved in the lookup process. But how exactly does DNS work? We’ll run you through the process from start to finish, in an easy to understand way. If you’re in a rush, scroll down below the list to see this process explained in a flow chart graphic instead!
To help with our explanation, we’ll be using an example, where Bob is trying to find the Website Builder Expert homepage.
1. Bob types “www.websitebuilderexpert.com” into his search bar
Bob can’t remember IP addresses for websites (he’s only human after all), so he searches the web using easy to remember domain names instead. This is the only thing Bob needs to do – the DNS takes care of everything from this point onwards.
2. Bob’s browser checks its cache to see if it has this domain stored already
If you’ve already visited a website, your browser may have it stored in its memory (or “cache”) – if it does, then it can load the webpage faster, because it doesn’t have to go through the whole DNS process.
We’ll be imagining that Bob’s browser doesn’t have www.websitebuilderexpert.com stored in its cache.
3. Bob’s operating system asks a resolving name server for the IP address of www.websitebuilderexpert.com
Because Bob’s web browser and operating system don’t know the correct IP address, they need help. The operating system asks the resolving name server for www.websitebuilderexpert.com. This request is called a query.
4. The resolving name server queries a root name server
The resolving name server doesn’t know the correct IP address. So it finds a root name server and asks for the IP address of www.websitebuilderexpert.com.
5. The root name server directs the resolving name server to a relevant TLD server
The root name server doesn’t know the IP address either, but it does know where the resolving name server can find a TLD (Top Level Domain) name server. This narrows down the domain to .com, .org, .co.uk, and so on.
The root name server gives the resolving name server the address of a TLD name server. In this case, it would be a .com TLD.
The resolving name server puts all this information in its cache, and goes to find the TLD name server.
6. The resolving name server queries the TLD name server
This time, the resolving name server asks the TLD name server for the IP address of www.websitebuilderexpert.com.
7. The TLD name server directs the resolving name server to an authoritative name server
The TLD name server can’t give the resolving name server the IP address – instead, it can give it the address of the authoritative name server. In other words, it gives directions to the example.com name servers.
When a domain name is purchased, the registrar (for example, GoDaddy) is told which authoritative name server that domain should use. The TLD name servers are then updated to reflect this information.
The resolving name server once again stores all this information in its cache and goes to find the authoritative name server.
8. The resolving name server queries the authoritative name server
“Do you know the IP address for www.websitebuilderexpert.com?” This time, when the resolving name server makes its query, it gets a new response: “Yes!”
The authoritative name server responds with the correct IP address, which the resolving name server puts in its cache and takes back to the operating system.
9. The resolving name server delivers the IP address for www.websitebuilderexpert.com to the computer operating system
The operating system takes the IP address and gives it to the web browser. The web browser connects to the IP address, which means…
10. The web browser uses the IP address to load the webpage for www.websitebuilderexpert.com
And Bob can happily browse through the page he was looking for!
This may seem like a complicated and lengthy process – you may even imagine Bob sitting there, drumming his fingers on his desk and wandering off to make a cup of coffee while he waits for the servers to hunt down his IP address.
But what’s amazing is that this whole lookup process happens faster than the blink of an eye!
Now you know how DNS queries work, and everything that happens behind the scenes when you search for a domain online. If you’re after real nitty gritty DNS stuff though, check out the three different types of query in the DNS system below.
A recursive query means that the DNS must deliver an answer to the user – whether that’s the correct IP address or an error message.
The recursive query process sees the resolving name server go through the entire process listed above, until it reaches the authoritative name server and can deliver the correct IP address for the web browser.
With an iterative query, the DNS provides the best answer it can to the user. This time, if the resolving name server has the relevant information stored in its cache, it delivers that result straight away.
If it doesn’t have the answer, the user gets referred to a root server or an authoritative name server that’s more likely to contain the answer. The user will keep getting referred down the chain until they either receive a result or an error message.
A non-recursive query is where the DNS already knows the answer – for example, when it has the information already stored in its cache, and can deliver an answer to the query immediately.
If it doesn’t have the answer saved in its cache, it will query an authoritative name server that is guaranteed to have the correct IP address, so the user still receives an immediate and accurate response.
Unlike the other two query types, non-recursive queries don’t need to go through various rounds of queries – the answer is direct and immediate.
Although the DNS lookup process is pretty fast by itself, it’s made even faster by caching. But what is caching? And where does it take place?
In essence, caching improves performance and reliability by temporarily storing data in a variety of locations. Ideally the data gets stored close to the user, so that the request can be met as soon as possible, speeding up the process.
If a user types in a domain, and the IP address is already stored in the cache, then it removes the need to go through the whole DNS lookup process. This places less strain and demand on the DNS, frees up bandwidth, and improves load speeds for the user.
So where exactly is data stored? Here are the two main caching locations for DNS:
Most web browsers automatically cache DNS records, which makes sense – the closer this data is stored to the user’s request (i.e. typing a URL into a search bar), the faster that request can be met.
By heading off the request at its source, and delivering the IP address within the web browser itself, the DNS doesn’t need to go through all the steps of querying every server, every time.
Checking the web browser’s cache for answers is the first step to the DNS lookup process.
Operating System Level Caching
If the web browser doesn’t have an IP address in its cache, the next place data gets stored is your computer’s operating system. This the last place for the query to go before it has to leave your machine to find answers.
When a request comes into the operating system, the DNS client (or “stub resolver” if you want something more fun) processes the request. It first checks its cache to see if it already has the answer – in which case, it sends the IP address straight back to the web browser.
However, if it doesn’t have the data stored in its cache, that’s when it sends a DNS query to the resolving name server, kickstarting the DNS lookup process outside of your computer.
The resolving name server will also check its own cache to see if it has the data stored, before querying the other servers in the DNS lookup process.
You can see why caching has the potential to seriously speed up the DNS lookup process!
DNS has a lot of parts that work together to provide results, whenever we search the web using domains. Because of all these moving parts, DNS can seem a tricky concept to get your head around.
But it doesn’t have to be! By taking the process apart, you can get to grips with DNS and understand just how much it shapes the way we navigate the web.
To quickly recap, DNS stands for Domain Name System. It translates human-friendly domain names into computer-friendly IP addresses, so that web browsers can load the correct page for users.
There are several stages that make up the DNS lookup process, which relies on four main servers to answer queries and find the right IP address. There are also different types of query, to spread out the pressure placed on different servers throughout the process.
The DNS lookup process can be sped up by caching, which is where data gets stored on your machine.
If your web browser has the right IP address in its cache, it can immediately answer its own request and load the page straight away, speeding up the process and removing the load placed on the DNS.
The good news is, DNS is designed to work quickly and efficiently behind the scenes to load web pages fast. It happens so fast, in fact, that most people have no idea of all the hard work going on behind the scenes when they search for a web page.
Now that you’ve read our beginner’s guide, though, you can hold up your hand and proudly say you know what DNS is, how it works, and why it’s important!