DNS-Domain Name System is a system that translates website names to IP addresses.
![](https://codelido.com/assets/files/2022-08-30/1661858127-401052-d-n-s-r-e-s-o-l-v-e-r-1.png)
As you can see in the above picture we have taken a website “www.rahulsai.com” so now the following steps will describe how DNS works internally.
We will enter a website in our web browser, here we took “www.rahulsai.com”
Now this website will go to the ISP(Internet Service Provider) from ISP it will go to the DNS resolver. Here the resolver will be operated by the ISP. So now this will start looking at the website name in its local cache if it is found then it will return to the web browser.
If the website is not found in the local cache then the resolver sends the request to the “ROOT SERVER”. The root server will be checking the TLD(Top Level Domain) of the website.
Note1: There are a total of 13 root servers across the globe.
Note2: TLD-Top level Domain are .com, .dev, .org, etc which come after the domain name and are known as TLD.
For ex: www.rahulsai.com provides details to the .com TLD server likewise so many TLD servers will be there based upon their TLD name.
Now this TLD from the root server will be given to the resolver.
Now the resolver sends the query to the TLD server and the TLD server searches for the website. Here in this case it is rahulsai.com.
After finding the website name it will tell the resolver that go to rahulsai.com.
Now this query from the resolver goes to the “AUTHORITATIVE SERVER” (In an authoritative server, all website’s IP addresses will be stored), and now it will search for rahulsai.com and finds the IP address of that website.
Now that server returns that IP address to the resolver.
The resolver will give that IP address to the web browser.
The web browser will be pointing to that particular web server.
All required files (like HTML, CSS, JavaScript, etc) to load the webpage will be given to the web browser.
Finally our website will be displayed on our web browser.
So this is how a DNS server works internally.
If a website is found in the local cache it will not go for the entire process it will simply return to the web browser, if not found it will go through the entire process.
Feel free to comment and Thank you for reading my blog 🙂