Private Dns Across Multiple Vpcs
Private DNS Across Multiple VPCs with Route 53
The moment you have more than one VPC, DNS becomes an architecture problem: the app VPC needs to resolve db.internal.example.com, the management VPC needs to resolve names in every app VPC, and public zones must not leak internal topology. This post covers the multi-VPC private DNS pattern the Route 53 module implements.
The problem with private hosted zones
A Route 53 Private Hosted Zone (PHZ) resolves only inside VPCs it’s associated with. Naively, that means associating every zone with every VPC — O(zones x VPCs) associations that sprawl fast and break the moment a VPC lives in another account or region, which requires an authorization handshake.
The hub pattern
+------------------------+
mgmt VPC ---->| shared services |
(resolvers) | + inbound endpoint |<---- on-prem via VPN/DX
+-----------+------------+
| PHZ association
+--------------+--------------+
app VPC A app VPC B data VPC
(internal (internal (internal
zone) zone) zone)
Two mechanisms do the work:
- PHZ association — associate a consumer VPC with a zone hosted in the shared-services account. Cross-account association needs
CreateVPCAssociationAuthorizationfrom the zone owner plusAssociateVPCWithHostedZonefrom the VPC owner; the module wraps both sides so it stays oneapply. - Resolver endpoints + forwarding rules — for anything that can’t be associated (on-prem DNS, a partner’s zone, managed AD), Route 53 Resolver inbound/outbound endpoints forward queries. The
vpc-dns-forwarder/dns-forwarder-rulesmodules build exactly this: an inbound endpoint other VPCs forward to, and rule sets mapping domains to resolver IPs.
Health-checked routing as a bonus
The same module optionally layers Route 53 health checks and failover records — so a DNS name can prefer a healthy regional endpoint and fail over automatically. Combined with ACM wildcard certs issued and validated through DNS automatically, you get “one record set, TLS included” as a paved path for service teams.
What to watch for
- Overlapping zones win by specificity —
internal.example.comin one VPC andexample.comin another is legal; resolution picks the most specific match. Powerful, but document it or someone will “fix” it. - DNSSEC validation on resolvers can break forwarding to zones that don’t sign — know before enabling.
- DNS hostnames/resolution VPC attributes must be enabled or PHZ association silently doesn’t work — a top-3 cause of “Route 53 doesn’t resolve.”
Takeaway
Centralized DNS is one of those “foundation” capabilities every platform team eventually builds: one shared zone strategy, association-as-code, resolver endpoints for the exceptions. Doing it in Terraform turns a documentation exercise into a repeatable pattern every new VPC inherits for free.