Understanding Domain Name Servers and Web Addresses resolution

What happens when we type a website address in a browser's address bar?

Simple, we get the web page hosted on that address but there are a number of processes taking place behind the scenes. The machines on web don't understand the human readable domain names (eg: www.humlog.net) but they need addresses in a format called IP address. So there must be someone sitting in between our browser and the web server (on which the web page is hosted/stored) who translates this human readable domain name to machine understandable IP address. This translation is called Domain Name Resolution and it can happen in your browser or in your computer, or in your router or on the web.
Let us understand these behind-the-scenes processes.

  1. All browsers have their own caches which store the most recently browsed domains and their IP addresses. So the first step in Domain Name Resolution is for the browser to check in its cache for an entry of the current domain name. If it finds an entry in cache, it reads the corresponding IP address and forwards it to the machines on web, so that they can find the address and return the contents sitting on that address. In this case the Domain Name Resolution happened in the browser's cache.

  2. If the browser cannot find an entry in its cache, then the request for Domain Name Resolution goes to the Operating system's caches. If OS finds an entry in its cache, the Domain Name Resolution happens in the OS itself.

  3. If the OS cannot find an entry in its cache, then the request for Domain Name Resolution goes to the DNS resolver configured in the computer. A DNS resolver contains address of the DNS server which will be used for Domain Name Resolution. Usually the DNS resolver is auto configured as part of IP configuration by the Internet service providers.

  4. DNS resolver forwards the request to the DNS server. From here on, the process of Domain Name Resolution gets interesting.

  5. A DNS server contains a mapping of domain names and their corresponding IP addresses and is capable of querying other DNS servers on web in case, it itself doesn't contain a domain name entry.

  6. Every DNS server knows the address of the root DNS server which contains a mapping of all the top-level domains and their corresponding IP addresses. Top-level domains are the last part of your domain name (in www.humlog.net, its net). For querying the root DNS server, the domain name is broken into parts starting backwards. So if the domain name is www.humlog.net, first part from backside is 'net'. A query is made to root DNS server asking for the IP address of the DNS server responsible for .net domains.

  7. Now this DNS server, which is responsible for .net domains, is queried for the next part of the domain, i.e. humlog. This will return the address of the name server of the website (humlog.net)

  8. In the final step, the name server of website is queried for the next part, i.e. www. This will return the IP address of the domain name 'www.humlog.net' and we can get to see the contents of the website.

Simple, isn't it? :P:D

Category: internet-technologies