DNS & Working
Basics
DNS is a fundamental part of the internet that allows us to access websites and online services by using human-friendly names instead of numerical addresses. But how does it work exactly?
What is DNS?
DNS is like a phone book for the internet. It maps domain names, such as www.example.com, to IP addresses, such as 192.0.2.1, which are the actual locations of the servers that host the websites. This way, we don't have to memorize long strings of numbers to visit our favorite sites. We can just type in the name and let DNS do the rest.
How does DNS work?
When you type in a domain name in your browser, your computer will first check its local DNS cache to see if it has the answer. If it does, it will use that answer. If it doesn't, it will send a query to a DNS resolver.
The resolver will then check its own cache to see if it has the answer. If it does, it will send the answer back to your computer. If it doesn't, it will send the query to another DNS resolver. This process will continue until the answer is found or the query times out.
A DNS resolver is a server that stores DNS records and answers DNS queries.
Let's break it down with an example. Suppose you want to visit www.example.com. Here is the list of steps or places involved in getting the response for www.example.come:
Local Caches are checked
Recursive DNS Servers are checked
Root DNS Servers are checked
Top Level Domain DNS Servers are checked
Authoritative DNS Servers are checked
Reference Article: https://cs.fyi/guide/everything-you-need-to-know-about-dns
Last updated