DNS (Domain Name System) is often called the “phonebook of the internet.” This module takes you from basic understanding to mastering DNS architecture, record types, troubleshooting, and security.
; A Records - IPv4 addressesexample.com. A 93.184.216.34www.example.com. A 93.184.216.34; AAAA Record - IPv6 address www.example.com. AAAA 2606:2800:220:1:248:1893:25c8:1946; CNAME - Alias (cannot coexist with other records for same name)blog.example.com. CNAME www.example.com.; MX - Mail servers (lower number = higher priority)example.com. MX 10 mail1.example.com.example.com. MX 20 mail2.example.com.; TXT - Verification, SPF, DKIMexample.com. TXT "v=spf1 include:_spf.google.com ~all"example.com. TXT "google-site-verification=abc123..."; NS - Nameservers for this domainexample.com. NS ns1.example.com.example.com. NS ns2.example.com.
$TTL 86400@ IN SOA ns1.example.com. admin.example.com. ( 2024010101 ; Serial 7200 ; Refresh (2 hours) 3600 ; Retry (1 hour) 1209600 ; Expire (2 weeks) 86400 ; Minimum TTL (1 day)); Nameservers@ IN NS ns1.example.com.@ IN NS ns2.example.com.; A Records@ IN A 93.184.216.34www IN A 93.184.216.34mail IN A 93.184.216.35; Mail@ IN MX 10 mail.example.com.; CNAMEblog IN CNAME www.example.com.
1. You update record on authoritative server2. Old records still cached at: - Recursive resolvers worldwide - ISP DNS servers - Browser caches - OS caches3. Each must wait for TTL to expire4. Then they query again and get new record
TTL = 3600 (1 hour)0:00 - Record changed0:01 - Users with fresh cache see new IP0:30 - ~50% of caches expired, see new IP1:00 - Most caches expired1:30 - Stragglers with extended caching2:00 - 99%+ should have new record
RECURSIVE (client → resolver):Client: "Give me the final answer"Resolver: Does all the work, returns final IPITERATIVE (resolver → authoritative): Resolver: "Where should I look next?"Server: "Try this other server"(Resolver follows the chain)
; Main site@ IN A 93.184.216.34www IN A 93.184.216.34; Subdomains pointing to different serversapi IN A 93.184.216.100blog IN A 93.184.216.101shop IN CNAME shopify.com.; Wildcard (matches anything)* IN A 93.184.216.34
Public DNS (internet):app.company.com → 203.0.113.50 (public IP)Private DNS (internal): app.company.com → 10.0.1.100 (private IP)db.company.com → 10.0.2.50 (no public record)
# 1. Check if DNS returns any resultdig example.com# 2. Check specific nameserverdig @ns1.example.com example.com# 3. Verify nameservers are correctdig example.com NS# 4. Check propagation# Use whatsmydns.net