What Is AWS Route 53?
Route 53 is AWS’s managed DNS service. On top of standard DNS that maps domain names to IPs or AWS resources, it provides traffic routing policies and health-check-based failover. The “53” in the name comes from the UDP/TCP port number used by DNS.
This guide focuses on operating DNS in an AWS environment. Separate from looking up records with dig on the client or configuring Cloudflare DNS, it covers how to design and configure Route 53’s routing policies and health checks.
Core Components
| Component | Description |
|---|---|
| Hosted Zone | A collection of records for one domain (e.g., example.com) |
| Public hosted zone | DNS exposed to the internet |
| Private hosted zone | DNS resolved only inside a specific VPC |
| Record | Actual DNS entries such as A, AAAA, CNAME, MX |
| Alias record | Route 53-specific record that points to AWS resources (ELB, CloudFront, S3, etc.) |
| Health check | Periodically checks endpoint health |
| Routing policy | Determines which response to return among multiple records with the same name |
Creating a Hosted Zone
#
aws route53 create-hosted-zone \
--name example.com \
--caller-reference "$(date +%s)"Once created, Route 53 assigns four name servers (NS). You must update the NS records at your domain registrar to these values to complete delegation.
# check
aws route53 get-hosted-zone --id Z123456ABCDEFG \
--query 'DelegationSet.NameServers'Record Types
| Type | Purpose |
|---|---|
| A | Domain → IPv4 |
| AAAA | Domain → IPv6 |
| CNAME | Domain → another domain (alias). Not allowed at the zone apex |
| Alias | Points to an AWS resource. Allowed at the apex; no query charges |
| MX | Mail servers |
| TXT | Text such as SPF and domain verification |
| NS | Delegation of a subdomain |
| SRV | Service location |
You cannot use a CNAME to point the root domain (example.com) at an ELB or CloudFront. Use a Route 53 Alias record instead: it can target AWS resources even at the zone apex, with no extra query charges.
Changing Records with the CLI
Record changes in Route 53 are submitted as a JSON change batch to change-resource-record-sets.
# change-batch.json
cat > change-batch.json <<'JSON'
{
"Comment": " A ",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"TTL": 300,
"ResourceRecords": [{ "Value": "203.0.113.10" }]
}
}
]
}
JSON
aws route53 change-resource-record-sets \
--hosted-zone-id Z123456ABCDEFG \
--change-batch file://change-batch.jsonAction supports CREATE, DELETE, and UPSERT (update if present, create if not). UPSERT is the safest choice for idempotency.
Health Checks
Some routing policies work together with health checks. A record is included in responses only while its endpoint is healthy.
aws route53 create-health-check \
--caller-reference "$(date +%s)" \
--health-check-config '{
"Type": "HTTPS",
"FullyQualifiedDomainName": "www.example.com",
"Port": 443,
"ResourcePath": "/health",
"RequestInterval": 30,
"FailureThreshold": 3
}'| Setting | Meaning |
|---|---|
Type | HTTP / HTTPS / TCP / string matching, etc. |
ResourcePath | Path to check (e.g., /health) |
RequestInterval | Check interval in seconds. 10 or 30 |
FailureThreshold | Mark unhealthy after N consecutive failures |
Health checks run from many locations worldwide. Allow Route 53 health checker IP ranges and the check path (/health) in your firewall/security groups, or the endpoint will never be considered healthy.
Routing Policies
These rules decide which answer to return when multiple records share the same name and type. This is the core of Route 53.
1) Simple
The default. You set values on a single record and Route 53 returns them as-is. If there are multiple values, they are shuffled at random (no routing control).
2) Weighted
Distributes traffic across endpoints by ratio. Well suited to A/B tests and gradual (canary) rollouts.
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "app.example.com", "Type": "A", "TTL": 60,
"SetIdentifier": "v2-canary",
"Weight": 10,
"ResourceRecords": [{ "Value": "203.0.113.20" }]
}
}A record with Weight 90 and another with 10 split traffic roughly 9:1. Use SetIdentifier to distinguish records that share the same name.
3) Latency
When resources exist in multiple AWS regions, Route 53 sends users to the region with the lowest latency. Set the Region property.
{
"Name": "api.example.com", "Type": "A", "TTL": 60,
"SetIdentifier": "seoul",
"Region": "ap-northeast-2",
"ResourceRecords": [{ "Value": "203.0.113.30" }]
}4) Failover
You define Primary and Secondary records. Route 53 answers with Primary while the health check is healthy, and with Secondary when it is not. Use this for active-standby.
{
"Name": "www.example.com", "Type": "A", "TTL": 60,
"SetIdentifier": "primary",
"Failover": "PRIMARY",
"HealthCheckId": "abcd-1234-health",
"ResourceRecords": [{ "Value": "203.0.113.10" }]
}The Primary failover record must have a health check attached. Without one, Route 53 always treats Primary as healthy and never fails over to Secondary.
5) Geolocation
Returns different answers based on the user’s location (continent/country/region). Used for content localization and regulatory compliance.
{
"Name": "www.example.com", "Type": "A", "TTL": 60,
"SetIdentifier": "korea",
"GeoLocation": { "CountryCode": "KR" },
"ResourceRecords": [{ "Value": "203.0.113.40" }]
}When using Geolocation, always create a default record ("CountryCode": "*") for users who match no region. Otherwise unmatched users get no answer.
Policy Comparison
| Policy | Decision basis | Health check | Typical use |
|---|---|---|---|
| Simple | None | Optional | Single endpoint |
| Weighted | Weight ratio | Optional | A/B, canary deploys |
| Latency | Lowest-latency region | Optional | Multi-region performance |
| Failover | Primary health | Required | Active-standby |
| Geolocation | User location | Optional | Localization and compliance |
| Geoproximity | Location + bias | Optional | Fine-tuning regional traffic |
| Multivalue | Random healthy records | Optional | Simple distribution plus health |
TTL Design Tips
| Situation | Recommended TTL |
|---|---|
| Records that rarely change | 3600 seconds or more |
| Frequent changes (Failover / Weighted, etc.) | Around 60 seconds |
| Just before a migration | Lower in advance (e.g., 60 seconds) |
Alias records do not let you set TTL yourself. They inherit the TTL of the target AWS resource.
Summary
| Topic | Key point |
|---|---|
| Hosted zone | Per-domain record set, public or private |
| Alias | Point to AWS resources at the zone apex, no query charges |
| Record changes | change-resource-record-sets + UPSERT |
| Health check | Path, interval, and threshold; required for Failover |
| Weighted | Ratio-based distribution (canary/A/B) |
| Latency | Choose the lowest-latency region |
| Failover | Failover based on Primary health checks |
| Geolocation | Location-based routing; a default (*) record is required |
Route 53’s real value is not plain DNS but the combination of routing policies and health checks. For multi-region services, combine Latency and Failover; for gradual rollouts, use Weighted—raising both availability and user experience.
AI tools may assist drafting. Check the evidence in each guide for whether commands were run and which environment was used. Confirm the current docs for your version before applying instructions, and email us about errors. email us
Questions & answers
Ask a question about this guide. We'll review and reply.