DNS Resolution

[!NOTE] This module explores the core principles of DNS Resolution, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. What is DNS?

The Domain Name System (DNS) is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet. It translates human-friendly names (e.g., google.com) into IP addresses (e.g., 142.250.190.46).

2. The DNS Hierarchy

DNS is organized like an inverted tree:

  1. Root Servers (.): There are 13 main root clusters globally. They know where the TLD servers are.
  2. TLD (Top-Level Domain): Servers for .com, .org, .net, .io, etc.
  3. Authoritative Servers: Servers owned by companies (e.g., Google or Amazon) that hold the actual records for their domains.

3. Common Record Types

  • A: Maps a hostname to an IPv4 address.
  • AAAA: Maps a hostname to an IPv6 address.
  • CNAME (Canonical Name): Alias. Maps one hostname to another.
  • MX (Mail Exchanger): Identifies the mail server for a domain.
  • TXT: Arbitrary text (used for security verification like SPF/DKIM).

4. Interactive: Trace the Query

Follow the resolution path.

💻
You
1. Root (.)
2. TLD (.com)
3. Authoritative
Waiting...

5. Propagation & TTL (Time To Live)

When you change a DNS record, it isn’t instant.

  • DNS Caching: Your computer, your ISP, and even your browser cache DNS results to save time.
  • TTL: The duration (in seconds) that a DNS record is cached. A low TTL (e.g., 300s) makes changes faster but increases server load.