How DNS Works: A Step-by-Step Guide to DNS Resolution
Every time you type google.com into your browser, your computer has no idea where Google actually lives on the internet. It only understands IP addresses, not human-friendly domain names. So how does it find the correct server in just a few milliseconds? That's exactly what DNS does.
What is DNS ?
Every device connected to the internet has an IP address. Websites are hosted on servers, and those servers are identified using IP addresses, something like - 142.250.183.14. For humans, it is almost impossible to remember hundred of IP addresses so domain names were created like google.com, swiggy.com, netflix.com. Your browser needs the server's IP address before it can establish a connection. That's why DNS (Domain Name System) was created. Think of it as the internet's phonebook—it translates human-readable domain names into IP addresses.
How DNS Works ?
When you enter a domain into your browser, the browser first checks its DNS cache, if you have visited same website recently - the browser finds the IP adress in its cache and connects directly to the server. If the browser doesn't find the IP, it asks the operating system, which also maintains a DNS cache. If the operating system finds the IP address in its cache, it returns it to the browser. But if the IP address isn't found in the operating system's cache then comes the role of DNS Resolver (Recursive Resolver).
What is DNS Resolver ?
A DNS resolver is a server that translates human-readable domain names (like google.com) into machine-readable IP addresses (like 142.250.183.142). Acting as an intermediary between your device and the global internet, it handles the complex process of finding the correct IP address so your browser can load websites.
The Resolution Process
When you type a URL into your browser, DNS Resolver takes full responsibility for tracking down the right destination through the domain hierarchy.
The resolver is called a recursive resolver because it takes full responsibility for finding the answer on your behalf. Instead of making your computer contact multiple DNS servers, it performs the entire lookup process and returns the final IP address.
1. Cache Check :
The resolver first checks its own cache to see if it already knows the IP address from the recent request. If the resolver has recently looked up the same domain for any client it serves, it may already have the answer cached. The IP address is stored in the cache until its Time To Live (TTL) expires. If resolver finds the IP address in its cache then it returns the IP to the browser which can then load the website.
2. Root Server :
If the resolver fails to find the IP in cache then the resolver sends a query to one of the DNS root servers. The root server doesn't know the IP address, but it knows which Top-Level Domain (TLD) server is responsible for .com, .org, .in, and so on.
3. TLD Server :
Each top-level domain such as .com, .org, or .in is managed by its own set of TLD name servers. The TLD server also doesn't know the actual IP address. Instead, it tells the resolver which authoritative name server is responsible for the requested domain.
4. Authoritative Server :
The authoritative server is the source of truth for a domain. The Authoritative server stores the DNS records (such as A, AAAA, CNAME, MX, etc.) for the domain. It returns the actual IP address to the resolver. Resolver returns the IP to browser and also stores in the cache for future requests.
Now browser has the actual IP of the requested domain, browser can now connect to the server and load the website. The next time you visit the same website, the browser, operating system, or DNS resolver may already have the answer cached. That means the entire lookup process can often be skipped, making website loading much faster.
Once the browser knows the server's IP address, it can establish a TCP (or QUIC for HTTP/3) connection and begin the HTTPS communication.

