Split-Horizon DNS
Internal vs external DNS views for the same domain, use in VPCs and split-tunnel VPNs, and private hosted zones.
Overview
Overview Split-horizon DNS (also called split-brain DNS or split-view DNS) is a configuration where the same domain name returns different DNS responses depending on the source of the query. External clients resolving api.example.com receive the public IP of a load balancer; internal clients within the VPC receive the private IP of the same service, bypassing the load balancer and NAT gateway entirely.
This pattern is fundamental to cloud networking. In AWS, Route 53 private hosted zones implement split-horizon DNS natively — you create a private hosted zone for example.com, associate it with specific VPCs, and records in that private zone shadow the public hosted zone for queries originating inside those VPCs. The resolver inside the VPC (169.254.169.253, the VPC's built-in resolver at the second IP of the VPC CIDR) checks private hosted zones first, then falls through to public DNS.
Split-horizon DNS solves the hairpinning problem. Without it, an application inside a VPC that calls api.example.com would resolve to the public ELB IP, send traffic out through the internet gateway, have it NATted back in, traverse the ELB, and reach the target — adding latency and NAT gateway cost. With a private hosted zone pointing api.example.com to the internal ALB or directly to service IPs, traffic stays on the AWS private network.
The same pattern applies to split-tunnel VPNs. Employees connected to a corporate VPN with split tunneling receive internal DNS responses for company domains (routing those queries through the VPN tunnel to an internal resolver) while public internet traffic bypasses the VPN. The VPN client is configured with DNS search domains that determine which queries go to the internal resolver.
Split-horizon DNS introduces operational complexity. When internal and external views diverge, debugging connectivity issues requires knowing which view a client is using. Certificate management must account for both views — internal services may use private CAs or self-signed certificates that external clients should not trust.
Key concepts
- Private Hosted Zone (Route 53)
- VPC Resolver (AmazonProvidedDNS)
- DNS Search Domain
- Hairpinning
- Route 53 Resolver Rules
Interview questions
- How does split-horizon DNS work in AWS, and how would you implement it for a service that has both internal and external clients?
- How does DNS resolution work over VPC peering, and what do you need to enable for split-horizon DNS to work across peered VPCs?
Sign up free to read the full topic
More Networking topics
Start free on Cariara · Coding problems · System design studio