As soon as it finds the IP address it returns the IP address back to the user and also caches it for its future use. If it still can’t find the IP Address then it goes through a process or recursive DNS query in which it queries different nameservers to get the IP address of the domain. A DNS server is usually given to you by the ISP or you can manually set up a DNS server for yourself. If it can’t find the IP address in its cache it queries the DNS server to see if it has a record for it.
A cache usually contains a mapping of IP addresses to hostnames which are saved during recent lookups so that the resolver does not have to fetch the IP address again and again. It first checks its local cache to see if it can find a record for the queried domain name.
It is now the responsibility of the DNS resolver in the user’s operating system to fetch the IP address. Let’s say the user opens up the browser and types in. So Let’s understand how DNS resolution works. We will look more into Resource Records and the zone file in the next section. These records can provide us a bunch of information about the domain. A zone file is a file on the server that contains entries for different Resource Records (RR). This process may take place through a local cache or through a zone file that is present on the server. This is because domain names are much easier to remember than IP addresses. DNS converts human-readable domain names into IP addresses.