Route 53 hosted zones · Lesson 4 of 8 · 3 min read
Split-horizon DNS
The pattern
The same domain hosted in a public zone and a private zone with different answers:
Enlarge diagram
Swipe sideways to see all of it, or tap to open it full screen.
- Clients inside associated VPCs get the internal answer: traffic stays private, skips the WAF/NAT/internet path, and can reach internal-only features.
- Internet clients get the public answer.
Uses
- Same URLs in apps and certificates everywhere (
https://api.example.com), while internal traffic stays internal. - Internal-only subdomains that must never appear publicly.
- Gradual migrations (internal clients moved first).
Pitfalls
- No fallback — every name that internal clients need from
example.commust exist in the private zone too (MX, verification TXT if anything inside queries them, other public hosts). Many teams avoid this by using a dedicated subdomain for private zones (internal.example.com,prod.aws.example.com) instead of overlapping the apex. - Two sources of truth to keep in sync — manage both in code.
- Debugging confusion — "it works from my laptop but not from the server" because they see different answers. Always check where a query originates.
- TLS: certificates must cover the names on both internal and external endpoints.