Resolving domain is the process of mapping a text to a unique number in order to connect and get the required information from the web server. Here the text is domain name entered as part of URL in the address bar and number is the IP address of a web server in which the information is stored. In this article, we will explain the detailed process of how resolving domain to IP address works in internet.
Understanding IP and Domain Name
We will explain this article with site address www.google.com as an example. In simple terms the site address is nothing but a domain name.
- com is a top level domain
- google is subdomain of com
- www is subdomain of google.
A domain name associated with an IP address is called host name. Open a web browser (we recommend Google Chrome) in your computer and type the address www.google.com. Press enter key to open Google website. Open another browser tab or window and type this number 184.108.40.206 in the address bar and press enter. Surprised!!! Yes this will also open the same Google website.
So what’s the catch? Every domain name (site address) is mapped to a number called Internet Protocol (IP) address in the internet. Entering the domain name google.com will be mapped to the server’s IP address 220.127.116.11 and then the browser will try to contact that IP directly to get the required information using Hyper Text Transfer Protocol. Big websites like Google can also associate with multiple IP addresses. It is very difficult for us to remember the IP numbers and hence the domain names are used for the purpose of ease and resolving host is nothing but the process of getting that unique IP address number.
Earlier some browsers like Firefox, by default shows the domain name, IP address and server location of the site in browser’s address bar. You can also use browser extensions to display these details whenever you open any site.
How Does it Resolve?
Well, again we will explain with simple example of using Windows 8 and Google Chrome browser. Open network and sharing center and go to the properties of TCP/IPv4 or TCP/IPv6 whichever you use. You will see two sections – one for obtaining IP address automatically from your ISP and other is to obtain DNS servers from manual configuration.
Now choose the manual DNS server option “Use the following DNS server addresses:” and enter junk value for preferred server as 1:1:1:1 for TCP/IPv4 and 2000:2000:2000:: 2222 for TCP/IPv6 and leave alternate server details as blank. Click OK to save your entries. Open chrome browser, type google.com and press enter. You will see a “Resolving host…” message for some time and then the web page not available message.
Now type the IP address 18.104.22.168 and press enter, Google site will open much faster (faster than opening google.com with correct DNS). Got it? The DNS servers do the necessary action to get the IP address of a host or domain name you entered in the browser. Preferred server works as a primary server and the alternate server works as a fallback when the primary server fails.
How the Complete Communication Works?
When you enter a URL in browser running on a local client computer, the browser gets the DNS server details from the network settings of your computer. DNS servers will have the required mapping of domain names to IP address and work like a network structure in hierarchy. If the first DNS server does not have the mapping it will request the next level DNS server 2. This will continue till the time the IP address is obtained and the same is returned to the browser. (You will see a resolving host message till the time browser gets the IP address of the site you entered).
DNS Caching is used in every level including Chrome browser and your local PC or Mac in order to save time during this resolving host process. This means browser and DNS servers cache the IP address of the host names and use it when processing the repeated requests next time. This helps to increase the speed of website loading without trying to get the real IP address every time from the server. However, there is a possibility of another issue due to IP change. When the website owner changes IP address of a site that you are trying to access, the cached IP returned by the DNS servers will not match with the new IP of the site. Again browser will try to resolve the host till the time it gets the correct IP.
This whole communication happens through TCP/IP protocol structured in every computer. Once the browser gets IP address of a domain, it will directly broadcast request to the server through Hyper Text Transfer Protocol (HTTP). The server will receive the request, process it and send the HTML code of the webpage to browser. Finally, browser interprets the HTML markup to display it in a readable format and you see an attractive webpage.
As you can see, resolving domain name to IP address is the basic of viewing websites in web browser. Domain Name System (DNS) helps to speedup this process so that you will never realize the mapping is happening when you open a website. When there is a problem in mapping, you will see a “Resolving host…” message in browser’s status bar or the webpage will take long time to load. In all such cases, you can use VPN, flush DNS or check with your ISP to reset DNS and speedup the resolving process.