DNS & CDN
A Record
Maps domain → IPv4 address. example.com → 93.184.216.34. Most fundamental record type.
AAAA Record
Maps domain → IPv6 address. Same as A record but for IPv6. example.com → 2606:2800:220:1:248:1893:25c8:1946.
CNAME Record
Alias from one domain to another. app.example.com → myapp.herokuapp.com. Cannot coexist with other records at the same name. Not allowed at zone apex.
MX Record
Mail exchange — where to deliver email. Priority + target. Lower priority number = higher preference. example.com MX 10 mail.example.com.
TXT Record
Arbitrary text. Used for SPF (email auth), DKIM, domain verification (Google, AWS). example.com TXT 'v=spf1 include:_spf.google.com ~all'.
NS Record
Nameserver delegation. Tells resolvers which DNS servers are authoritative for a domain. example.com NS ns1.cloudflare.com.
TTL (Time to Live)
How long DNS resolvers cache a record (seconds). Low TTL (60s) = fast updates, more DNS queries. High TTL (86400s) = fewer queries, slow propagation. Typical: 300-3600s.
CDN Architecture
Edge servers (PoPs) worldwide cache content close to users. Origin → Edge → User. Reduces latency from ~200ms (cross-continent) to ~20ms (nearest PoP).
CDN Cache Hierarchy
L1: Edge PoP (closest to user). L2: Regional/Shield (intermediate). Origin: your server. Reduces origin load — only L2 misses hit origin.
CDN Cache Invalidation
Purge by URL, tag, or prefix. Cache-Control headers: max-age, s-maxage, stale-while-revalidate. Versioned URLs (/style.abc123.css) — best practice, instant invalidation.