How DNS resolution works
When a browser requests api.streamhub.com, it does not know the server's IP. A multi-step lookup resolves the name.
DNS lookup path (Route 53)
StreamHub production architecture (AWS)
Resolution chain
- Browser cache — recent lookups cached for TTL seconds.
- OS resolver cache — local stub resolver.
- Recursive resolver — ISP DNS or public resolver (8.8.8.8, 1.1.1.1).
- Root → TLD → authoritative — delegation until the domain's nameserver answers.
- A/AAAA record — IPv4 or IPv6 address returned to the client.
# Trace a lookup (simplified)
dig +trace api.streamhub.com A
# Check TTL — how long clients cache this answer
dig api.streamhub.com | grep -E 'ANSWER|IN A'
DNS record types you need
| Record | Purpose | Example |
|---|---|---|
| A / AAAA | Hostname → IP | api.streamhub.com → 52.12.34.56 |
| CNAME | Alias to another name | www → streamhub.com |
| MX | Mail server | mail.streamhub.com |
| TXT | Verification, SPF, DKIM | v=spf1 include:... |
| NS | Authoritative nameserver | ns1.cloudprovider.com |
| SRV | Service location | _https._tcp service discovery |
A / AAAA
PurposeHostname → IPExampleapi.streamhub.com → 52.12.34.56CNAME
PurposeAlias to another nameExamplewww → streamhub.comMX
PurposeMail serverExamplemail.streamhub.comTXT
PurposeVerification, SPF, DKIMExamplev=spf1 include:...NS
PurposeAuthoritative nameserverExamplens1.cloudprovider.comSRV
PurposeService locationExample_https._tcp service discovery
For system design interviews, A/AAAA, CNAME, and TTL matter most.
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 4 sections
- TTL and caching trade-offs
- DNS in scaled architectures
- DNS as a failure point
- Internal vs external DNS
Test yourself
Answer these before moving on — recall is what makes it stick.