DNS infrastructure really makes Internet surfing an easy and pleasant experience. Have you ever thought about how connectivity for too many humans around the world is possible? DNS process is complex, and it repeats millions of times every day. Would you like to know some of the responsible actors for this scene to work efficiently? Let’s start with servers. Authoritative and recursive servers.
What is DNS for?
Let’s make it simple, Domain name system (DNS) is a database that contains domain names easy to understand and memorize for humans and their associated IP addresses, the long numerical codes that machines use to communicate between them.
DNS translates domain names required by users into IP addresses for machines to execute different tasks while looking for such domains until the point domains get successfully loaded for users.
What is an authoritative DNS server?
Authoritative DNS servers are where important DNS data (DNS records) about domains are saved. They can be servers belonging to a domain registrar or a DNS hosting provider.
Many authoritative servers are covering different regions. They give answers to queries only for the DNS zones they have been set up.
In general, they have two main missions. The first one is, holding the database of domain names and their corresponding IP addresses. And the second mission is giving answers to recursive DNS servers, providing them the correct IP address for every domain requested by a user.
An authoritative server doesn’t cache any result of queries. It works with the original data that is saved directly in its system.
What is a recursive DNS server?
Recursive DNS servers are the ones in between authoritative servers and users. They search for the necessary information to answer users’ queries. There are many recursive DNS servers globally. Probably the most common recursive servers for you are the ones of your Internet service provider (ISP).
Every time a user requests a domain through a browser, a recursive DNS server searches for its correct IP address. They look for this info because, remember, they are searchers, not the holders of the database where such information is established. Once the recursive server gets the accurate IP address, it sends it to the computer’s browser that requested it. The computer connects to the provided IP address, and the domain gets loaded for the user.
The search of a recursive server can go in these two main ways.
When a query is received, the first alternative is to check if the IP address is still saved in its cache memory. Recursive servers’ cache can be configured to save information for a specific time period. Based on their needs, domain owners define the time period for this to happen through the time-to-live (TTL) value of the DNS records.
Then, if the cache’s TTL hasn’t expired, the recursive server can find the IP address there without asking other servers. To answer the user’s query will be easy and fast.
The second option is, when the information is not anymore saved in the cache, the recursive server will have to search an authoritative server to ask for the correct IP address. This process can take a little longer.
How many times have you heard that whatever you need is just a click of distance? Well, if that premise can be established is thanks to the DNS. Now you know that behind every click searching for something online, there is a massive DNS scene taking place. Without authoritative and recursive DNS servers, Internet’s experience as we know it couldn’t exist.