Imagine you’re trying to find a famous biryani shop in Hyderabad. You don't know the exact house number; you just know the name of the shop. You ask a local elder, they point you to the right neighborhood, someone there points you to the specific lane, and finally, a shopkeeper in that lane points you to the door.
DNS (Domain Name System) is exactly that guide for the internet. Computers are great with numbers (IP addresses like 142.250.190.46), but humans are better with names like google.com. DNS exists to translate those names into numbers so our browsers can find the right server.
1. What is DNS and why name resolution exists
Computers communicate using IP Addresses. Every website lives on a server with a unique numerical ID. However, expecting a person to remember 172.217.167.142 instead of google.com is impossible.
Name Resolution is the process of mapping a human-friendly domain name to a machine-friendly IP address. DNS acts as the "Phonebook of the Internet." When you type a URL, your system initiates a "resolution" to find the target IP. Without this, the internet would be unusable for regular people.
2. What is the dig command and when it is used
If DNS is a phonebook, dig (Domain Information Groper) is your tool to look inside it. It is a powerful command-line utility used by engineers to troubleshoot and "X-ray" the DNS process.
While a browser just gives you the final webpage, dig shows you the raw data packets being exchanged. You use it when a site won't load, when you've just updated your server settings, or when you want to see exactly which "layer" of the internet is providing your information.
3. Understanding dig . NS and root name servers
The DNS system is organized like an upside-down tree. At the very top is the Root. In technical terms, the root is represented by a single dot (.).
When you run dig . NS, you are asking for the Name Server (NS) records of the entire internet's root. There are 13 primary root server clusters globally. They don't know the IP of Google, but they are the "Admins" who know exactly who is in charge of extensions like .com, .in, or .org.
4. Understanding dig com NS and TLD name servers
Once the root server sees you are looking for something ending in .com, it directs you to the Top-Level Domain (TLD) Name Servers.
By running dig com NS, you are querying the records for the .com registry. These servers are the "managers" for that specific extension. They don't have the final IP address yet, but they have a list of the specific Authoritative servers for every single registered .com website in existence.
5. Understanding dig google.com NS and authoritative name servers
Now we reach the "Source of Truth." When you run dig google.com NS, you are asking the TLD servers for the Authoritative Name Servers that Google itself manages.
The Authoritative server is the "Final Boss." This is the server where the domain owner (Google) stores their official records. When you query this level, you are getting the information directly from the source, rather than a cached copy. The NS records here point to the specific machines (like ns1.google.com) that hold the actual IP address.
6. Understanding dig google.com and the full DNS resolution flow
When you run a simple dig google.com, you are looking at the final answer of a complex relay race. In the real world, your browser doesn't do all this walking; a Recursive Resolver (provided by your ISP or Google 8.8.8.8) does it for you.
The Full Resolution Flow:
- Request: Your browser asks the Resolver, "Where is google.com?"
- Root: Resolver asks the Root (.). Root says, "I don't know, but ask the .com TLD."
- TLD: Resolver asks the .com TLD. TLD says, "Ask Google's Authoritative servers."
- Authoritative: Resolver asks Google's server. It says, "The IP is 142.250.190.46."
- Result: The Resolver gives this IP to your browser, and the page loads.
- This layered system ensures the internet stays fast and scalable. By using dig at each step, you can verify if a lookup is failing at the Root, the TLD, or the Authoritative level.
Resources




Top comments (0)