DNS service is very important for using our everyday tools today. All our banking apps, Alexa, Siri, Google Assistant, booking sites, etc, all make use of DNS in order to provide their services. This is why we want highly available servers and the fastest response possible to all users.
What would happen if it took 5 seconds to get a response from our phone when setting a new Alarm with a voice assistant? Most of us most probably would take the phone and do it manually instead. DNS is part of the primary delays when accessing a service that uses the internet, so we want DNS to be super fast. How can this be accomplished?
If you checked the previous post about DNS, you found that it requires to ask many servers in order to get the final answer and it could take many milliseconds. Using a previous example of finding out a phone number from a friend, what is faster to look at it in your contacts list or ask your sister who you already know that will know the answer for sure?
Maybe your sister/brother keeps looking in the contacts list for the phone every few minutes, that makes it faster for you to ask her. In this case she is providing a caching service to you.
This is why most, if not all internet service providers will use DNS caching servers. It is the most effective way to provide faster responses to their subscribers. A caching server will not bother on asking root servers and other authoritative servers, they just ask one server (recursive server) usually in their local network to do that on its behalf and save on its own database all the most common DNS requests for the time that the DNS answer is still valid.
This way all users benefit from the previous requests that were done by other users from the same internet provider. Usually these caching servers are physically located nearer to the subscribers to reduce latency time.
In a nutshell, a caching DNS server answers what it already knows and is still valid, otherwise it will ask another server to get the valid response.
You might want to check related posts below:
What are DNS recursive servers?
One thought on “What are DNS caching servers?”