Route 53
Route 53 is AWS’s DNS service. It connects your domain name to your load balancers, CloudFront distributions and other endpoints.
On this page · 5 min · Intermediate
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Intermediate
- Updated
- Oct 29, 2026
Learning objectives#
- Create a hosted zone
- Add common record types
- Use alias records for AWS resources
- Understand routing policies and health checks
Explanation#
A hosted zone holds the DNS records for a domain. Point your registrar’s name servers to the four Route 53 name servers.
Common records: A (IPv4), AAAA (IPv6), CNAME (alias to another name, not allowed at the zone apex), MX (mail), TXT (verification, SPF).
Alias records are a Route 53 feature that can point the apex (techiebabaji.com) at CloudFront, a load balancer or S3, and queries to AWS resources are free.
Routing policies: simple, weighted, latency-based, failover (with health checks), geolocation and more.
Code example: Alias the apex domain to CloudFront#
{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "techiebabaji.com",
"Type": "A",
"AliasTarget": {
"HostedZoneId": "Z2FDTNDATAQYW2",
"DNSName": "d1234abcd.cloudfront.net",
"EvaluateTargetHealth": false
}
}
}]
}
// aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://change.json
{ "ChangeInfo": { "Status": "PENDING" } } — after propagation, techiebabaji.com resolves to the CloudFront distribution.This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.
Step-by-step explanation#
- UPSERT creates the record or updates it if it exists.
- An A record with AliasTarget works at the zone apex, where CNAME is not allowed.
- Z2FDTNDATAQYW2 is the fixed hosted zone ID AWS uses for all CloudFront aliases.
Real-world use case#
techiebabaji.com and www point to CloudFront for the React site; api.techiebabaji.com points to a load balancer.
Common mistakes#
DNS forbids it. Use an alias A/AAAA record.
Records in Route 53 do nothing until the domain uses Route 53’s name servers.
Best practices#
- Use alias records for AWS endpoints
- Keep TTLs low before migrations
- Use health checks with failover routing for critical sites
- Enable DNSSEC where appropriate
Remember this#
Hosted zone = the domain’s record book.
Apex → alias record, never CNAME.
Routing policies: simple, weighted, latency, failover, geo.
Practice exercise#
Your task: Which record type would you add to verify domain ownership for an email provider?
Show solution
A TXT record containing the verification string the provider gives you.
Mini quiz#
Which record lets the apex domain point to a load balancer?
Want more? Practise all AWS MCQs · AWS interview questions
My notes#
Saved in this browser.