In the previous article of the „What is a DNS?“ series we learned more about the Levels of а Domain Name in the DNS Index and that the important А record „domain.name=IP address“ can be located on the very last domain level. In this article we will describe the steps which the DNS resolver* performs during the DNS lookup in order to reach the А record.
To begin, we remind you that the DNS resolver is an application most often located on an ISP’s DNS server. With it there might be a DNS cache application which keeps data of the DNS lookups performed.
After the DNS resolver receives a query for the domain’s IP it initiates a DNS lookup as it sends a request/query to one of the root servers.
Translating the Domain Name into an IP Address (DNS Name Resolution)
( 1 ) The user enters the domain name superhosting.bg in the browser’s address bar to access SuperHosting.BG’s website. The browser needs the IP address of the web machine where the website’s files are located. So the browser looks for the DNS client which first checks for „domain.name=IP address“ in the local DNS cache and the operating system’s hosts file. If there is no data for the domain and its IP address there, the local DNS client sends a query to the DNS resolvers, specified in the operating system’s network connectivity settings.
( 2 ) When there is no cache data for the domain on the DNS server, where the DNS resolver is located, the resolver initiates a DNS lookup. It will first look for the root DNS server to ask “Which is the IP of superhosting.bg’s domain?” The DNS resolver knows beforehand what the IPs of the 13 DNS root servers are, so it does not perform a DNS lookup of their domains (a-m.root-servers.net).
( 3 ) One of the root DNS servers then responds that it does not hold any such data, but it points to the authoritative name servers for the .bg level/domain and directs the resolver to the name servers of the next level. In this case these are the NSes of the .bg domain. (ns.register.bg, ns2.register.bg, ns3.register.bg, ns4.register.bg). It should be noted that besides for the name servers, the root DNS server will send the respective IPs to the resolver so that it will not be necessary to perform a DNS lookup of their domains as well (ns.register.bg, ns2.register.bg). This further IP data is called Glue records.
( 4 ) The DNS resolver then sends the question „What is the IP of superhosting.bg’s domain?“ to the NSes for .bg domains.
( 5 ) The responsive for the .bg zone servers will neither hold this data (А record), but they can point to the authoritative superhosting.bg servers. They serve the next NS to the resolver: sns1.superhosting.bg, sns23.superhosting.bg.
( 6 ) Then the resolver sends the question „What is the IP of superhosting.bg’s domain“ to superhosting.bg’s NS.
( 7 ) The name servers of superhosting.bg are called authoritative name servers because the DNS domain zone is located there. The DNS zone contains the DNS records. The required data for the IP is stored in the DNS A record. One of superhosting.bg’s NS sends the searched data back to the resolver.
( 8 ) The resolver sends a copy of the received DNS data to the DNS cache and forwards it also to the DNS client which was looking for it at the beginning. All upcoming queries for the same domain will get the stored DNS data.
Before the DNS data reaches the browser it gets through the local DNS client and is saved in its DNS cache.
After the browser receives the IP address it connects to the web server to download and load the website’s files.