Skip to main content

Command Palette

Search for a command to run...

How DNS Resolution Works

Understanding How DNS Resolution Functions

Published
3 min read

What is DNS and why Name resolution exist?

A DNS (Domain Name Server) is like a internet phonebook which converts general human readable websites names (like example.com) convert into a machine language Ip address to redirect the any specific website in your system.

Why name resolution exist?

  1. Human usability: Humans can remember and understand alphabetical names easily like www.google.com but IP address like 192.164.2.3 are difficult to remember for every sites these are easy for machines.

  2. Efficient Networking: Computers required numerical address for the routing of traffic correctly.

  3. Flexibility: Computer system can change their physical address and no need to remember IPs just need Domain names will be same because DNS handle in backend.

  4. Distributed System: Enables fast scalable and decentralized access.

What is dig command and when it is used?

DIG(Domain Information Groper) is a flexible and command line interface which is used to check DNS and solve the issues in the Domain Name Server.

When it is used ?

  1. To diagnose the reason that why DNS is not resolving. and troubleshooting that issue.

  2. To check if DNS record changes for example if A record changes then it must be distributed across the internet.

  3. By using dig trace+ it trace the entire resolution from root to domain’s A server.

Understanding dig.NS and root name server

dig.NS shows the Authoritative name server for the root zone, which form the starting point of the global DNS resolution process.

Root Name Server:

A root name server is a name server for the root zone of the Domain Name System (DNS) of the Internet

Understanding dig com NS and TLD name servers

dig com NS returns the authoritative name servers for the .com top-level domain, which are responsible for delegating queries to domain-specific authoritative servers.

TLD Name Server:

TLD (Top level Domain) Name server manages all domain names for a specific extension, like .com, .org, acting as a directory one level below the root servers in the DNS hierarchy,

Understanding dig google.com NS and authoritative name servers.

The dig google.com NS command is used to query DNS server for A Name Server (NS record) responsible for google.com.
It return the specific servers eg. ns1.google.com.

dig @ns1.google.com google.com

Understanding Authoritative Name Servers

Authoritative name servers contain the final, official DNS records for a domain, such as A, AAAA, MX, and TXT records.

google.com.   172800  IN  NS  ns1.google.com.
google.com.   172800  IN  NS  ns2.google.com.
google.com.   172800  IN  NS  ns3.google.com.
google.com.   172800  IN  NS  ns4.google.com.

Understanding dig google.com and full DNS resolution flow.

dig google.com asks your recursive DNS resolver (like your ISP or 8.8.8.8) for the IP address of the domain, and the resolver then finds the answer by querying root → TLD → authoritative servers, often using cache

Full DNS resolution flow.