AWS — Route 53
What is Route 53?
Scalable DNS web service for domain registration and routing.
Create hosted zone
aws route53 create-hosted-zone \
--name example.com \
--caller-reference $(date +%s)
Create record
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890 \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{"Value": "1.2.3.4"}]
}
}]
}'
Record types
| Type | Purpose |
|---|---|
| A | IPv4 address |
| AAAA | IPv6 address |
| CNAME | Alias to another name |
| MX | Mail exchange |
| TXT | Text record |
| Alias | AWS resource alias |
Health checks
aws route53 create-health-check \
--caller-reference $(date +%s) \
--health-check-config \
IPAddress=1.2.3.4,Port=80,Type=HTTP,ResourcePath=/
Failover routing
{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"SetIdentifier": "primary",
"Failover": "PRIMARY",
"AliasTarget": {
"HostedZoneId": "Z1234567890",
"DNSName": "elb.amazonaws.com",
"EvaluateTargetHealth": true
}
}
}]
}
Domain registration
aws route53 domains register-domain \
--domain-name example.com \
--duration-in-years 1 \
--admin-contact ...
Best practices
- Use health checks
- Set appropriate TTL
- Use alias records for AWS resources
- Enable DNSSEC
Mini Practice
- Create a hosted zone
- Add an A record
- Set up health checks
- Configure failover routing
Up Next
Continue with ECS - Container Service.
Related Topics
Frequently Asked Questions about Route 53
What is Route 53 in AWS?
Route 53 is a fundamental concept in AWS. This lesson explains it step by step with clear examples, making it easy for beginners to understand.
How do I learn Route 53?
Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Route 53.
Why is Route 53 important in AWS?
Route 53 is essential for AWS development. Understanding this concept will help you write better code and solve real-world problems more effectively.