Route 53 Resolver and hybrid DNS
The VPC resolver
Every VPC has the Route 53 Resolver (historically "AmazonProvidedDNS") at base + 2 and 169.254.169.253. It answers from these sources:
- Private hosted zones associated with the VPC.
- VPC-internal names — EC2 private DNS (
ip-10-0-1-5.ap-south-1.compute.internal), interface endpoint private DNS. - Resolver forwarding rules associated with the VPC — matching queries are sent to the rule's target DNS servers.
- Public DNS — recursive lookups on the internet for everything else.
When a forwarding rule and a private zone cover overlapping names, the most specific domain match decides; avoid identical overlaps and test the result with dig from inside the VPC.
It's only reachable from inside the VPC (and connected networks via inbound endpoints). Each ENI can send a limited rate of queries to it (1024 packets per second per network interface); exceeding it causes throttled/dropped queries — a real problem for chatty Kubernetes nodes, mitigated with NodeLocal DNSCache and caching in apps.
Hybrid DNS with endpoints
Two kinds of Resolver endpoints (ENIs in your subnets, at least two AZs):
| Endpoint | Direction | Use |
|---|---|---|
| Inbound endpoint | On-prem → AWS | On-prem DNS servers conditionally forward queries for AWS names (e.g. internal.example.com, *.amazonaws.com for private endpoints) to the inbound endpoint's IPs over VPN/Direct Connect |
| Outbound endpoint + forwarding rules | AWS → on-prem | Queries from VPCs for corp.local (or corp.example.com) are forwarded to on-prem DNS servers |
resource "aws_route53_resolver_endpoint" "outbound" {
name = "to-onprem"
direction = "OUTBOUND"
security_group_ids = [aws_security_group.resolver.id] # allow UDP/TCP 53 to on-prem DNS
ip_address { subnet_id = var.subnet_a }
ip_address { subnet_id = var.subnet_b }
}
resource "aws_route53_resolver_rule" "corp" {
domain_name = "corp.local"
rule_type = "FORWARD"
resolver_endpoint_id = aws_route53_resolver_endpoint.outbound.id
target_ip { ip = "10.200.0.10" }
target_ip { ip = "10.200.0.11" }
}
resource "aws_route53_resolver_rule_association" "corp" {
resolver_rule_id = aws_route53_resolver_rule.corp.id
vpc_id = aws_vpc.main.id
}
- Forwarding rules can be shared to other accounts with AWS RAM and associated with their VPCs — so one central set of endpoints serves the whole organisation.
- System rules override forwarding for specific subdomains (e.g. forward
example.comon-prem but resolveaws.example.comlocally). - Endpoint capacity: each endpoint IP handles up to roughly 10,000 queries per second; add ENIs across AZs for scale and resilience.
- Security groups on endpoints must allow DNS (UDP and TCP 53).
A multi-account hybrid design
Route 53 Profiles
Profiles (launched 2024) bundle DNS configuration — private hosted zone associations, Resolver rules, DNS Firewall rule groups, some VPC DNS settings — into one object you share via RAM and associate with many VPCs. Instead of associating each zone and rule with hundreds of VPCs one by one, you associate one Profile. Changes to the Profile apply everywhere.
Resolver query logging and DNS Firewall
- Resolver query logs record every query from your VPCs (source IP/instance, name, type, response) to CloudWatch Logs, S3 or Firehose — invaluable for security investigations and debugging.
- DNS Firewall filters outbound DNS from VPCs: block known-malicious domains (AWS managed lists), block everything except an allow list for locked-down workloads, or alert. It mitigates DNS-based data exfiltration and malware command-and-control lookups, complementing network firewalls.