Official documentation for DNS routing, hosted zones, and record management. Read →
Route 53 is AWS's managed DNS service. You create a hosted zone for your domain, then add DNS records. It integrates natively with other AWS services — CloudFront, EC2, ALB — and supports health-check-based routing.
# Create a hosted zone for your domain
aws route53 create-hosted-zone --name yourapp.com --caller-reference "$(date +%s)"
# Note the NameServers in the output — update these at your registrar
# (Namecheap, GoDaddy, etc.) to delegate DNS to Route 53
# Point apex domain to CloudFront (use ALIAS, not CNAME)
# In the Route 53 console or via CLI:
{
"Name": "yourapp.com",
"Type": "A",
"AliasTarget": {
"DNSName": "d1234.cloudfront.net",
"EvaluateTargetHealth": false,
"HostedZoneId": "Z2FDTNDATAQYW2" // CloudFront hosted zone ID
}
}
# www subdomain → CloudFront
{
"Name": "www.yourapp.com",
"Type": "CNAME",
"TTL": 300,
"ResourceRecords": [{"Value": "d1234.cloudfront.net"}]
}
# api subdomain → EC2 Elastic IP
{
"Name": "api.yourapp.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{"Value": "54.210.1.100"}]
}
Route 53's ALIAS record is like a CNAME but works on the apex domain (yourapp.com). Use ALIAS when pointing to CloudFront, S3, or ALBs. It's free and resolves at the DNS layer.
Route 53 can monitor your endpoints and automatically failover to a backup if the primary goes down:
# Create a health check
aws route53 create-health-check --caller-reference "$(date +%s)" --health-check-config 'Type=HTTPS,FullyQualifiedDomainName=yourapp.com,Port=443,ResourcePath=/health'
# Route 53 will poll /health every 30 seconds
# If it fails 3 consecutive checks, it marks the record unhealthy
# and routes traffic to the failover record