DNS stands for Domain Name System and is an integral part of how we use the internet every day. Without it, the internet would be much harder to use and navigate–but just exactly what is DNS, and how does it work?
This article will break down the whole process in a jargon-free, step-by-step explanation–let’s get into the nitty-gritty details of DNS, shall we?
What Is DNS?
The Domain Name System is the unsung hero of the internet. Many people rely on it every day without even realizing it. DNS makes browsing the web accessible and easy for anyone to do.
Computers navigate the web using strings of numbers called IP addresses, that look like this: 123.456.7.7. The trouble is that we humans find numbers like this hard to remember, so we navigate the web using domain names like www.example.com.
DNS translates domain names into IP addresses that our web browsers can understand. Without DNS, we would all have to remember strings of numbers for the web pages we want to visit–that would make browsing the internet quite a headache!
How Does DNS Work?
The main role of DNS is to translate human-friendly domain names into computer-friendly IP addresses. But how exactly does it do that? To fully understand the DNS lookup process, you need to meet the four DNS servers.
The Four DNS Servers
These four servers each have their own role in the process – you can think of them as members of an archive team, working together to find a specific piece of information:
Here’s a quick run-down of each server and their roles:
- Resolving name server: this is the first server in the lookup process. It received the request and goes to each server in turn looking for the right IP address.
- Root name server: this server’s main job is to point the resolving name server in the right direction, so that it can find the correct TLD name server…
- TLD name server: TLD stands for Top Level Domain, and simply refers to the .com part of the domain. There’ll be a .com TLD server, another for .co.uk, .org, .net, and so on!
- Authoritative name server: this is the last server in the DNS lookup process. This is the server that can give the correct IP address to the resolving name server!
DNS Step-by-Step Breakdown
You’ve met each server, and now it’s time to see how they actually work together to translate a domain into an IP address. I’ll use an example to help walk through the DNS process: Bob is searching for www.iotforall.com. Let’s see what happens next…
- Bob types www.iotforall.com into his web browser.
- Bob’s browser checks its cache (memory) to see if it has the IP address for that website already. In this example, it doesn’t.
- A request gets sent via the computer’s operating system to the resolving name server. This kickstarts the DNS lookup process.
- The resolving name server doesn’t know the IP address, so it goes to the root name server and asks: do you know the IP address for www.iotforall.com?
- The root name server doesn’t know the IP address, but it does know which TLD name server to ask next. You need the .com TLD name server over there!
- The resolving name server goes to the .com TLD name server and repeats its query. The TLD name server has a list of all the .com domains and knows exactly where the resolving name server should ask next. You need the authoritative name server for iotforall.com!
- The resolving name server heads over to the authoritative name server and asks: do you know the IP address for www.iotforall.com? This time, it gets a new answer.
- The authoritative name server gives the correct IP address to the resolving name server.
- The resolving name server takes the IP address and returns to Bob’s computer. The operating system passes the IP address to Bob’s web browser, which uses it to load the correct web page.
- Bob happily spends time browsing on www.iotforall.com!
You can see why DNS relies on its four servers to translate domain names into IP addresses. Here’s a visual breakdown to help you figure out exactly how DNS works:
How DNS Works So Quickly
Now you know how DNS works, it may surprise you to find out that the whole DNS lookup process happens faster than the blink of an eye!
That means Bob doesn’t even have time to tap his fingers on his desk before the resolving name server has passed the correct IP address back to his web browser. As if that’s not fast enough, DNS has several methods in place to make sure it’s always as quick and efficient as possible.
One of the most common ways of speeding up the process is via caching. This refers to computers storing information in their memories.
So, the next time Bob searches for www.iotforall.com, his web browser will check its cache and find the correct IP address – meaning it can load the page instantly, without launching a DNS query.
Alternatively, the computer’s operating system may have the IP address stored in its memory. If the web browser doesn’t have the IP address in its cache, it sends the request to the operating system first.
If the operating system has that information stored in its memory, it can send the right IP address straight back to the web browser for an even faster result than launching a DNS query.
Different Types of DNS Query
Another way DNS stays speedy is by running different types of queries. There are three main types:
- Recursive query
- Iterative query
- Non-recursive query
The process we walked through earlier is an example of a recursive query – the DNS must deliver an answer, and go through every step until it can return either an IP address or an error message.
An iterative query will deliver the best answer it can – if the answer is stored in a cache, it will return the IP address straight away, but otherwise, it’ll keep going through each step until it achieves a result.
The fastest type is the non-recursive query, which is where the DNS already knows the answer and can deliver an answer immediately – when it already has the IP address stored in its cache, for example.
It’s okay if you’re not an expert in the different types of DNS queries. The main thing to know is that having three different types of DNS query stops the DNS servers from becoming overloaded by requests – and this keeps everything moving as quickly as possible.
DNS: Key Takeaways
The Domain Name System is an extremely fast and efficient process that we all rely on every single day. Without it, navigating the web would be a huge headache, as we would all have to remember strings of numbers to visit our favorite web pages!
Now you know what DNS is, and how it works–here’s a quick recap of the key takeaways you’ve gained from this simple DNS explanation:
- DNS stands for Domain Name System
- DNS translates user-friendly domain names into computer-friendly IP addresses
- There are four main DNS servers that work together to find the correct IP address
- The whole DNS lookup process happens faster than the blink of an eye
- DNS is quick and efficient – especially thanks to caching and three different types of DNS query