DNS (Domain Name System) is considered to be the most basic block of Internet, which means Internet would collapse without DNS. So, What is DNS?
The answer is it is a hierarchical distributed naming system for computers or any objects that are connected to the internet. And now, why DNS is considered to be the basic block of internet?
The answer for that question is just simple as it enables resolving FQDN (Fully Qualified Domain Name) into respective IP addresses and vice versa. Now again there arise a question, how does this work in the real world?
To understand the working of DNS, let us assume a scenario like you need to browse a website (example: http://www.example.com) and for that you will type http://www.example.com in your internet browser. And once you click “go” or press enter, there happens a number of operations before you have been directed to the original web page.
1. When you enter http://www.example.com and press enter, the browser actually takes the website as http://www.example.com.
Yes, you read it true. Though you type http://www.example.com the browser automatically adds a dot to the end of your address and this dot is called as the root hint or The Root name server. It represents the root of the internet’s namespace.
2. Now the browser (along with the operating system) checks for this address in our local machine, either in cache or in memory. They could even check in our hosts file too. If this address is present, it gets redirected to that specific IP address, which has been saved in the local machine. But what, if it can’t find such an address in local? It moves on to the 3rd step.
3. The operating system asks the resolving name servers (which is either configured manually or automatically within the OS), where to find The Root.
4. Querying this domain name (www.example.com) with The Root will give the IP address of TLD (Top Level Domain) name server (in our example it’s com name server), which the resolving name server is again redirected to reach the com name server.
5. The TLD name server responds to that query of resolving name server, with the IP address of Authoritative name servers (in our example it is example.com).
6. Now it moves to the IP address of Authoritative name servers. But how does this TLD knows which Authoritative name servers are to be used?
By making use of Domain’s Registrar. When a domain is purchased, the domain registrar is told which authoritative name servers it should be used. This update is intimated to the respective TLD name servers for its updation.
Again back to our step, the request is sent back to the Authoritative name servers and then this points the resolving name server to the exact IP address. Resolving name server passes this IP to the browser. The browser browses this IP address and the page is displayed finally.
Feeling confused 😦 ? Check for a good video on how DNS works. Happy Browsing 🙂