Registrar and hybrid DNS
The difference between a domain registrar and a DNS service, using Route 53 with a third-party registrar, and hybrid DNS with Resolver endpoints and DNS Firewall.
Registrar vs DNS service
- A domain registrar is where a domain name is bought, usually for a yearly fee: GoDaddy, Amazon Registrar (through Route 53), and others.
- The registrar usually provides a DNS service to manage the domain's records too.
- But another DNS service can be used. For example, buy the domain from GoDaddy and manage its records in Route 53.
Domain registrar ≠ DNS service, although every registrar usually comes with some DNS features.
A third-party registrar with Route 53
If a domain was bought from another registrar, Route 53 can still be its DNS service:
- Create a public hosted zone in Route 53 for the domain. Route 53 assigns it four name servers.
- At the third-party registrar, change the domain's name servers (NS records) to the four Route 53 name servers.
From then on, DNS queries for the domain are answered by Route 53. When a domain is registered with Route 53, it creates the hosted zone and sets this up automatically.
Hybrid DNS
By default, every VPC has a Route 53 Resolver (now named Route 53 VPC Resolver), at the VPC's base address plus two. It automatically answers DNS queries from the VPC's instances for:
- local names for EC2 instances;
- records in private hosted zones associated with the VPC;
- public names, by asking public name servers.
Hybrid DNS means resolving names between a VPC and other networks, such as a peered VPC or an on-premises network connected with Direct Connect or Site-to-Site VPN. On-premises servers can't use the VPC's Resolver directly, and the VPC's Resolver doesn't know the on-premises names. Resolver endpoints fix both directions.
Resolver endpoints
- Inbound endpoint: lets on-premises DNS resolvers resolve names in AWS: EC2 instances and records in private hosted zones, such as
app.aws.private. On-premises DNS servers forward those queries to the endpoint's IP addresses. - Outbound endpoint: lets the VPC Resolver forward queries to on-premises DNS resolvers, using forwarding rules that name the domains to forward, such as
onprem.private. An EC2 instance can then resolveweb.onprem.private. - Endpoints are network interfaces in the VPC's subnets (in at least two AZs for availability). Rules can be shared with other accounts through AWS RAM.
Route 53 Resolver DNS Firewall
DNS Firewall filters the DNS queries a VPC's instances make, allowing or blocking domains from customer-managed or AWS-provided lists. Its main use is stopping DNS exfiltration, where malware on a compromised instance sends data out by looking up names in a domain the attacker controls.
Real-world examples
- A start-up registered
startup.ioat another registrar years ago. It creates a Route 53 hosted zone and updates the name servers at the registrar, to use Route 53 routing policies and alias records. - A bank runs Active Directory DNS on premises. With an outbound endpoint and a rule for
corp.bank.local, its EC2 instances resolve on-premises names; an inbound endpoint lets its branch servers resolve*.aws.bank.localprivate hosted zone names.
Exam tips
- "Domain bought from another registrar, use Route 53" → create a public hosted zone and update the NS records at the registrar.
- "On-premises servers must resolve private hosted zone names" → Resolver inbound endpoint.
- "EC2 instances must resolve on-premises domain names" → Resolver outbound endpoint + forwarding rule.
- "Block instances from resolving malicious domains", "DNS exfiltration" → Route 53 Resolver DNS Firewall.
Common traps
- "You must transfer the domain to Route 53 to use it as DNS." Updating the NS records is enough.
- "Inbound and outbound are about internet traffic." They're about DNS queries into and out of the VPC.
- "On-premises servers can query the VPC+2 address directly." AWS doesn't support that; use an inbound endpoint.
Check yourself
Resolver endpoints need an on-premises network or a second VPC, and cost about $0.125 an hour per network interface, so instead:
Create a Route 53 Resolver inbound endpoint in the VPC, and configure the on-premises DNS servers to forward prod.internal queries to the endpoint's IP addresses.
Create a Resolver outbound endpoint and a forwarding rule for corp.example pointing to the on-premises DNS servers, and associate the rule with the VPC.
AWS documentation
Health checks
Route 53 health checks for endpoints, other health checks and CloudWatch alarms, how health is decided, private endpoints, and automated DNS failover.
Amazon CloudFront
CloudFront as a CDN, its origins, S3 with origin access control, VPC origins and public origins, CloudFront vs S3 replication, geo restriction, invalidations, signed URLs and price classes.