What Is DNS? A Comprehensive Guide To The Domain Name System
Most internet users face DNS every time they open their browsers without ever realizing it. Keep reading to learn all about the Domain Name System and how it helps us navigate the web.
The Domain Name System (DNS) is the bridge between humans and machines on the internet. If we define what DNS is in simple terms, it is a system that converts domain names into IP addresses to help access websites.
The DNS takes human-readable domain names we all recognize and uses DNS records saved on authoritative name servers to find the IP addresses that computers can understand.
It does this by taking a recursive query from the client (usually a web browser) and running it through several name servers that narrow down the search and find the correct IP address.
From the user’s point of view, they just enter a URL (Uniform Resource Locator) and see a website, but there’s a lot going on behind the scenes.
How does DNS really work?
Every single device connected to the internet is assigned an Internet Protocol address. IP addresses are like the street addresses of the internet. They make it possible to route traffic to and from the correct devices.
An IPv4 IP address might look like this: 18.104.22.168 (dot-decimal notation)
An IPv6 IP address might look like this: 2a01:23b5:d013::bb19:851a:ee1a (alphanumeric notation separated by colons)
If you know the IP address of the server that hosts the website, you can simply enter the IP address into your browser to view that website.
However, given that an IP address is just a string of numbers or numbers and letters, it is not particularly convenient for human users to remember or type into browsers. Instead, we use domain names, like www.example.com, with easy-to-remember words or phrases.
Each domain name has an IP address. To keep track of which IP address connects to which domain name, we rely on the DNS system.
The DNS system comprises DNS servers, some of which hold the actual DNS records. A DNS record stores information about which domain name points to which IP address.
When you enter a domain name into your browser, the domain name goes through the DNS lookup process. The lookup process compares the domain name against the relevant DNS record to know which IP address it should source the website files from.
There are several different stages in the lookup process, which include different kinds of servers. Each server’s job is to narrow down the search for the correct record to speed up the process of finding the correct IP address.
DNS server types
There are four different types of servers involved in the DNS resolution process:
- DNS recursor
- Root nameserver
- TLD nameserver
- Authoritative nameserver
Let’s take a closer look at each of them.
The recursive DNS server, or recursive resolver, receives requests from client machines. For example, it can receive a domain name from a web browser.
In most cases, recursive DNS servers make additional requests to other servers to meet the DNS query and provide the correct IP address. Typically, the resolving name server is the user’s internet service provider.
We might be placing root servers second, but they are responsible for translating domain names into IP addresses that machines can understand.
Root nameservers act as indexes from which other nameservers branch out. They are the reference point that directs the DNS query to a more specific location.
Top Level Domains (TLDs) are the last portion of domain names, for example, .com, .net or .org.
Top-Level Domain nameservers are servers that can direct DNS queries for domain names within a certain TLD. For example, any DNS recursive query for a .com TLD passes through the .com TLD nameserver.
The last nameserver relevant to DNS queries is the authoritative nameserver. Authoritative DNS servers manage the actual translation from domain names to IP addresses.
Provided that the authoritative server contains the correct record, it sends the correct IP address to the recursive resolver.
Authoritative DNS server vs. recursive DNS resolver
A recursive DNS server and an authoritative DNS server are both important parts of the DNS protocol as they serve different functions within it. They are the start and endpoint of the DNS infrastructure.
In essence, the resolver is the server asking the question, while the authoritative server is the one answering it.
The recursive name servers are the DNS servers tasked with receiving queries from a DNS client and doing the legwork of finding IP addresses in the DNS records. They make requests to other name servers, from the root server down to the authoritative server, and then return the requested IP address back to the client.
Most recursive DNS servers cache DNS records. DNS caching means that recursive servers are able to provide the resolution to requests sooner and without having to make multiple requests as part of every lookup.
On the other hand, an authoritative DNS server stores the actual DNS data. This data is like a reference list at the end of the lookup process, where the domain name is listed next to its corresponding IP address.
The authoritative server is the ultimate source of truth in the DNS system. Provided the server contains the correct record during the query, it returns the IP address to the client, allowing the web browser to access and display the requested website for the user.
Since it is at the end of the chain, the authoritative server does not make any further queries to find the record. It only receives queries from the recursive resolver and provides the requested DNS records if able to do so.
DNS lookups and DNS records
At the core of the DNS system are the DNS records. These are the listings that indicate which website domain name relates to which IP address. It is these records that are being searched for during a DNS lookup.
A DNS lookup can take mere milliseconds, but there are still quite a few stages that most lookups go through. Below are the details on how a lookup is carried out, as well as how exactly DNS records are stored.
To locate records that aren’t stored in a short-term DNS cache, resolvers need to go through the records lookup. This usually includes action from all of the different kinds of servers mentioned above in sequence.
Here are the steps of the DNS lookup process:
- The user enters a domain name into the web browser.
- The browser sends a new DNS query via the internet to a DNS recursive resolver. In most cases, the recursive resolver is the internet service provider.
- The DNS resolver queries a DNS root nameserver. This is a server that is able to direct the query to the correct TLD server.
- The root server provides the DNS resolver with the address of the Top Level Domain (TLD) server that corresponds to the domain being queried.
- Once it knows the address of the TLD, the DNS resolver sends a request to the TLD server for direction to the relevant authoritative nameserver.
- In response to this request, the TLD sends the DNS resolver the IP address of the domain’s authoritative nameserver.
- Finally, the recursive resolver queries the domain’s authoritative nameserver to get the domain’s IP address.
- If the correct authoritative nameserver is being queried, it returns the DNS record for the relevant domain, along with the IP address.
Once all of these steps are complete, the user’s web browser can make an HTTP request to the IP address provided by the DNS. This allows the browser to render the webpage returned by the server.
All of this happens in less than a second as the web page loads.
A DNS record is the file that contains the information that a specific domain name maps onto a specific IP address.
We sometimes refer to the DNS system as the internet’s address book, but this isn’t totally accurate. Rather than being stored in one convenient place, DNS records are distributed across different servers all over the world.
That’s why the lookup process is designed to signpost the query to the correct name server.
Most frequently, when you register a domain name, your domain name registrar or hosting provider hosts the DNS record for your website. Your record is created automatically during domain registration. In this case, the lookup process involves the resolver locating the registrar or hosting provider’s server and accessing the record related to your website.
It is possible, but less common, to host your records on a private name server. It’s also possible to move existing records from one DNS name server to another. However, for most website owners, it’s sufficient to rely on their hosting provider’s default DNS server.
Most records exist on at least two servers: a primary server and a secondary server. If the primary server, for whatever reason, is offline or doesn’t respond, the secondary server can satisfy the query.
So, what is DNS? You should now understand that the Domain Name System is basically the internet’s phonebook. It is the system that holds the records of which website domain name corresponds to which IP address information.
As internet users enter memorable and recognizable domain names into web browsers, the DNS translates them into IP addresses.
And what is DNS lookup? In short, it is a complicated process of taking DNS requests and finding which URL matches which IP address.
A DNS lookup typically employs four different kinds of domain name servers to locate the correct DNS information, unless the resolving name server is using DNS caching to make the process faster.
About the author