Intermediate · 10 lessons

DNS

DNS (Domain Name System) is the phonebook of the internet. It translates domain names like example.com into IP addresses that computers use to connect. Without DNS, you would need to memorize IP addresses for every website you visit.

Key Concepts

A Record CNAME MX Record TXT Record TTL Nameservers DNS Propagation Reverse DNS

Key Takeaways

  • ✓ DNS converts domain names to IP addresses through a hierarchical lookup chain.
  • ✓ A records point domains to IPs; CNAME aliases one name to another.
  • ✓ MX records route email; TXT records verify SPF, DKIM, and domain ownership.
  • ✓ DNS changes propagate globally based on TTL — typically minutes to 48 hours.

Lessons in This Topic

1

DNS Fundamentals

Why DNS exists and how lookups work.

When you type example.com, your browser asks a recursive resolver (usually your ISP or 8.8.8.8). The resolver queries root servers → TLD servers (.com) → authoritative nameserver for example.com → returns the A record IP. Results are cached at each level based on TTL.
2

DNS Record Types

A, AAAA, CNAME, MX, TXT, NS, SRV, CAA explained.

A → IPv4 address. AAAA → IPv6. CNAME → alias to another hostname. MX → mail server priority. TXT → text data (SPF, DKIM, verification). NS → nameserver delegation. CAA → restricts which CAs can issue SSL certs. Each record type serves a specific purpose.
3

Recursive vs Authoritative DNS

The full resolver chain explained.

Recursive resolvers (Google 8.8.8.8, Cloudflare 1.1.1.1) do the lookup work for clients. Authoritative nameservers hold the actual zone data for a domain. Your hosting provider or Cloudflare hosts authoritative NS. Misconfigured authoritative NS is the #1 cause of "site not found" errors.
4

DNS Propagation & TTL

Why changes take time to go live worldwide.

TTL (Time To Live) tells resolvers how long to cache a record. Lower TTL (300s) before migrations speeds propagation. After changes, old cached values persist until TTL expires. Tools like whatsmydns.net show propagation status globally.
5

Troubleshooting DNS Issues

dig, nslookup, and common fixes.

Use `dig example.com` or `nslookup example.com` to test records. Check: correct nameservers, A record points to right IP, no typos in CNAME targets, MX priority order, SPF includes all sending servers. Flush local DNS cache if testing: `sudo dscacheutil -flushcache` on Mac.

Try the Interactive Simulator

1 Browser Query
2 Recursive Resolver
3 Root DNS
4 TLD Server
5 Authoritative NS
6 Response

Related Topics

Ask AI