Skip to main content

Command Palette

Search for a command to run...

How DNS Resolution Works

Published
2 min read

What is DNS and why name resolution exists

DNS (Domain Name System) is the internet’s phonebook.

  • Humans type names → google.com

  • Computers need numbers → IP addresses

  • Name resolution is the process of converting a name into an IP

Without DNS, you’d have to remember numeric IPs for every website — impossible at scale.

What is the dig command and when it is used

dig (Domain Information Groper) is a DNS debugging and inspection tool.

You use it to:

  • See how DNS answers are found

  • Check NS, A, MX, TXT records

  • Debug DNS issues (wrong IP, missing record)

Think of dig as show me what dns is actually doing behind the scenes

DNS resolution happens in layers

DNS works top-down, not all at once:

Root servers → TLD servers (.com, .org) → Authoritative servers (google.com)

Understanding dig . NS — Root name servers

dig . NS

It asks Who is responsible for DNS root

Ans: Root name servers

Very simple words → Root is the top level directory of the internet

Understanding dig com NS — TLD name servers

What it asks: Who manages all .com domains?”

Ans : .com TLD name servers

Key idea:

  • TLD servers know where each domain’s authoritative servers are

  • They still don’t know the website’s IP

Understanding dig google.com NS — Authoritative name servers

as the command suggest google is authoritative name servers.

Key idea:

  • These servers hold the real DNS records

  • A, AAAA, MX, TXT live here

Understanding dig google.com — Full DNS resolution

What happens (simplified):

  1. Recursive resolver starts at root

  2. Root points to .com

  3. .com points to google.com NS

  4. Authoritative server returns IP address

  5. Resolver gives IP to browser

Your browser:

  • Doesn’t talk to root/TLD directly

  • Uses a recursive resolver (ISP, Google DNS, Cloudflare)

Why NS records matter

NS records define authority.

They tell DNS:

  • Who is allowed to answer for a domain

  • Where the truth lives

Without correct NS records:

  • No website

  • No email

  • No verification

How this connects to real browser requests

When you open a website:

  • Browser → Recursive resolver

  • Resolver uses the same steps you saw with dig

  • dig just lets you see it manually

So: