← Back to Library Internet & Networking Beginner 8 min read

How DNS Works: The Internet Phonebook and Resolution Steps

The Domain Name System (DNS) is the decentralized hierarchical naming directory of the internet that translates human-friendly domain names (like cometflow.com) into computer-routable IP addresses (like 172.67.142.9).

💡 Plain-English Analogy

You do not memorize the 10-digit phone numbers of all your friends; your smartphone's contacts app looks up "Sarah" and dials her number automatically. DNS is the contacts app of the entire internet, looking up website names to find their numerical computer addresses.

⚙️ Architecture & Under the Hood

DNS operates over UDP port 53. Resolution follows a recursive query chain: Local Cache / OS Resolver ──▶ Recursive Resolver (ISP or 1.1.1.1) ──▶ Root Nameserver (.) ──▶ Top-Level Domain (TLD) Nameserver (.com) ──▶ Authoritative Nameserver for the target domain. Records are cached at every tier according to Time-to-Live (TTL) values.

The 4-Step DNS Lookup Journey

When you type a domain into your browser address bar for the first time, this resolution journey occurs in tens of milliseconds.

Browser ──(1. Where is example.com?)──▶ [Recursive DNS Resolver]
                                                    │
             ┌──────────────────────────────────────┼──────────────────────────────────────┐
             ▼                                      ▼                                      ▼
    [Root Server: "."]                    [TLD Server: ".com"]            [Authoritative DNS Server]
    "Go ask the .com server"              "Go ask example.com's NS"       "Here is the IP: 93.184.216.34"
             │                                      │                                      │
             └──────────────────────────────────────┴──────────────────────────────────────┘
                                                    │
Browser ◀──────────(Returns 93.184.216.34)──────────┘

Frequently Asked Questions

What is the difference between an A record and a CNAME record?

An A record maps a domain name directly to an IPv4 address (e.g. example.com ──▶ 93.184.216.34). A CNAME (Canonical Name) record aliases one domain name to another domain name (e.g. www.example.com ──▶ example.com).