route 53
My DNS provider went down on a Tuesday morning. Not just slow—completely offline.
For 6 hours, myapp.com didn’t resolve. Users got “DNS_PROBE_FINISHED_NXDOMAIN” errors. Our perfectly healthy servers sat there humming along, unreachable. We lost $40,000 in revenue and spent the next week apologizing to angry customers who thought we’d gone out of business.
That’s when I learned a brutal lesson: DNS is infrastructure, not an afterthought. And picking the right DNS provider matters more than most developers realize.
Enter Route 53. I migrated that same week and haven’t looked back. Let me show you why AWS’s DNS service is worth understanding, even if you’re not an AWS fanboy.
What Is DNS? (The 60-Second Version)
Before we dive into Route 53, let’s establish what DNS actually does.
When you type google.com into your browser, your computer doesn’t understand that. It needs an IP address like 142.250.185.46. DNS (Domain Name System) is the phonebook that translates human-readable domain names into machine-readable IP addresses.
The flow:
- You type
myapp.com - Your computer asks a DNS server “What’s the IP for myapp.com?”
- DNS server responds “It’s 54.231.145.22”
- Your browser connects to that IP
- Website loads
This happens in milliseconds, and you never think about it—until it breaks.
What Is Route 53?
Route 53 is Amazon’s highly available and scalable DNS web service. The name comes from TCP/UDP port 53, where DNS server requests are addressed. Clever, right?
But it’s more than just DNS. Route 53 also handles:
- Domain registration – Buy and manage domains directly
- Health checking – Monitor your endpoints and route traffic only to healthy resources
- Traffic management – Geographic routing, latency-based routing, weighted routing, and failover
- DNSSEC – Security extensions to prevent DNS spoofing
Think of it as DNS on steroids, designed for cloud-scale applications.
Why I Switched to Route 53
My previous DNS provider (a budget registrar) had three problems:
1. No health checks. If my server died, DNS kept pointing traffic to a dead IP. Users got connection errors instead of being routed to my backup server.
2. Slow propagation. Changes took 24-48 hours to fully propagate. Migrating servers was a nightmare of timing and crossed fingers.
3. Single point of failure. They went down, we went down. Simple as that.
Route 53 solved all three:
- Health checks automatically route around failures
- Changes propagate in under 60 seconds globally
- Built on AWS’s global network with 99.99% SLA
The cost? About $0.50/month per hosted zone plus $0.40 per million queries. I’m paying $2-5/month for bulletproof DNS. No-brainer.
How Route 53 Actually Works
Let’s walk through what happens when someone visits your site with Route 53 handling DNS.
The Query Flow
Step 1: User requests yoursite.com
Their computer checks its local DNS cache first. If it’s been less than TTL (Time To Live), it uses the cached IP. If not, it queries further.
Step 2: Recursive DNS resolver
The request goes to their ISP’s DNS resolver (or Google’s 8.8.8.8, Cloudflare’s 1.1.1.1, etc.). This resolver doesn’t know the answer yet.
Step 3: Root nameserver
The resolver asks a root nameserver “Who handles .com domains?” Root says “Ask the .com nameserver.”
–
Step 4: TLD nameserver
Resolver asks the .com nameserver “Who handles yoursite.com?” It responds “Ask AWS Route 53 at ns-123.awsdns-12.com.”
–
Step 5: Route 53 authoritative nameserver
Resolver asks Route 53 “What’s the IP for yoursite.com?” Route 53 checks its hosted zone records and responds with the configured IP.
–
Step 6: Response to user
The resolver caches this answer (per TTL) and sends it to the user’s computer. Browser connects. Website loads.
This entire chain typically takes 20-100ms. Route 53’s part is usually under 10ms because they have nameservers in hundreds of locations globally.
Key Concepts You Need to Know
Hosted Zones
A hosted zone is a container for all the DNS records for a specific domain. When you tell Route 53 to manage myapp.com, it creates a hosted zone with default NS (nameserver) and SOA (start of authority) records.
Each hosted zone costs $0.50/month. I have 8 hosted zones for various projects and side hustles.
Record Types (The Important Ones)
A Record – Maps a domain to an IPv4 address.myapp.com → 54.231.145.22
AAAA Record – Maps to an IPv6 address.myapp.com → 2600:1f18:1234:5678::1
CNAME Record – Points a domain to another domain.www.myapp.com → myapp.com
Gotcha: You can’t create a CNAME for the root domain (myapp.com). This frustrated me for hours until I discovered…
Alias Record – Route 53’s special sauce. Like a CNAME but works for root domains and is free (no query charges). Perfect for pointing to AWS resources.myapp.com → Elastic Load Balancermyapp.com → CloudFront distributionmyapp.com → S3 website endpoint
I use Alias records for everything AWS-related now.
MX Record – Mail server routing.
Tells email where to go. Essential if you’re using Gmail for your domain.
TXT Record – Text data for verification and configuration.
Used for domain verification, SPF records for email, DKIM signatures, etc.
NS Record – Nameserver records.
Points to Route 53’s nameservers. Auto-created, rarely touched.
TTL (Time To Live)
TTL tells DNS resolvers how long to cache your records (in seconds).
Low TTL (60-300 seconds): Changes propagate fast, but more queries hit Route 53 (higher cost, though negligible). Use during migrations or testing.
High TTL (3600-86400 seconds): Fewer queries, lower cost, but changes take longer to propagate globally.
My approach: I use 300 seconds (5 minutes) for A records of active services, 3600 seconds (1 hour) for stable records like MX and TXT.
Pro tip: Before a planned migration, lower your TTL to 60 seconds a day in advance. After the migration is stable, raise it back up.
Route 53’s Routing Policies: This Is Where It Gets Powerful
Standard DNS just returns an IP address. Route 53 can be smart about which IP to return based on various factors.
Simple Routing
One record, one or more IP addresses. Route 53 returns all IPs in random order.
When I use it: Single server setups or when I genuinely don’t care which server answers.
Weighted Routing
Split traffic based on percentages.
Example:
- New server gets 10% of traffic
- Old server gets 90% of traffic
Real use case: I was migrating from a Node.js monolith to a microservices architecture. I couldn’t flip the switch overnight. Weighted routing let me send 5% of traffic to the new system, monitor errors for a week, then gradually increase to 10%, 25%, 50%, 100% over a month.
If the new system crashed, I just changed the weight back to 0%. No code deploys, no rollback panic. Just a DNS change.
Latency-Based Routing
Route users to the AWS region with the lowest latency to them.
Setup: Create identical records for each region (us-east-1, eu-west-1, ap-southeast-1, etc.). Route 53 tests latency from the user’s location and returns the fastest one.
Impact: Cut average response time for international users from 600ms to 180ms. European users hit our Ireland servers, Asian users hit Singapore, Americans hit Virginia.
Cost: Zero extra for routing logic. You just pay for the health checks on each endpoint.
Geolocation Routing
Route based on the user’s geographic location, regardless of latency.
Different from latency-based: This is about where they are, not what’s fastest.
Real use case: Legal compliance. GDPR required us to keep EU user data in EU servers. Geolocation routing ensured EU users always hit our Frankfurt servers, even if Virginia would’ve been faster.
Also useful for content localization—serve Spanish content to users from Spain, English to users from the US.
Geoproximity Routing
Like geolocation but with bias. You can expand or shrink a region’s traffic share.
Example: You have servers in California and Oregon. By default, users in Nevada go to California (closer). But California is overloaded. Add a positive bias to Oregon, and it starts pulling some Nevada traffic.
Honestly, I rarely use this. Latency-based usually handles it better.
Failover Routing
Primary-secondary setup. Traffic goes to the primary; if health checks fail, Route 53 automatically routes to the secondary.
My disaster recovery setup:
- Primary: Application server in us-east-1
- Secondary: Static maintenance page in S3
If my app servers crash, users see “We’re experiencing technical difficulties. Check back in 30 minutes.” instead of connection errors. It’s not ideal, but it’s professional.
Health checks run every 30 seconds. When the primary recovers, traffic automatically switches back.
Multi-Value Answer Routing
Returns up to 8 healthy IP addresses randomly. It’s like simple routing but with health checks.
When I use it: Multiple independent servers behind the same domain without a load balancer. Each server is checked for health; only healthy ones are returned.
Health Checks: The Unsung Heroes
Route 53’s health checks are what make all the fancy routing actually work.
How Health Checks Work
You tell Route 53 to check an endpoint every 10 or 30 seconds (your choice).
Options:
- HTTP/HTTPS check: GET request to a URL. Success = HTTP 200-399 response within 2 seconds.
- TCP check: Establishes a TCP connection. Success = connection established within 10 seconds.
- String matching: Checks if response body contains a specific string. I use this to verify apps are actually working, not just returning HTTP 200.
Example: My health check hits /api/health which:
- Verifies database connection
- Checks Redis cache
- Returns
{"status": "healthy"}
Route 53 looks for the string “healthy” in the response. If it doesn’t find it, that endpoint is marked unhealthy within 60 seconds (after 2 consecutive failures).
Health Check Locations
Route 53 runs checks from multiple locations globally (typically 15+). You can set the threshold: “Mark unhealthy if 3 or more checkers fail.”
This prevents false positives from network blips in a single region.
Cost: $0.50/month per health check. I run 5 health checks (one per critical service) for $2.50/month. Worth every penny.
Practical Setup: How I Configure a New Domain
Let me walk you through a real-world setup from scratch.
Step 1: Create a Hosted Zone
AWS Console → Route 53 → Hosted Zones → Create
Enter your domain: myapp.com
Type: Public Hosted Zone
Click Create
Route 53 generates 4 nameservers like:
- ns-123.awsdns-12.com
- ns-456.awsdns-45.org
- ns-789.awsdns-78.net
- ns-012.awsdns-01.co.uk
Write these down.
Step 2: Update Nameservers at Your Registrar
Go to wherever you bought the domain (GoDaddy, Namecheap, etc.)
Find DNS settings and replace their default nameservers with Route 53’s 4 nameservers.
Wait time: 24-48 hours for full global propagation. Check with dig myapp.com NS or nslookup -type=ns myapp.com.
Step 3: Create A Record for Root Domain
Route 53 Console → Your hosted zone → Create Record
Type: A Record
Name: Leave blank (this makes it the root domain)
Value: Your server’s IP (e.g., 54.231.145.22)
TTL: 300 seconds
Routing Policy: Simple (or choose based on your needs)
Better option if using AWS: Use an Alias record pointing to your load balancer, CloudFront, or S3. Zero query charges.
Step 4: Create WWW Subdomain
Create Record → CNAME
Name: www
Value: myapp.com
TTL: 300
Now www.myapp.com points to myapp.com.
Alternative: Create another A record for www with the same IP. I prefer CNAME for flexibility.
Step 5: Set Up Email (If Needed)
Using Google Workspace or another email provider? Add their MX records.
Create Record → MX
Name: Leave blank
Value: (from your email provider, looks like 10 smtp.google.com)
TTL: 3600
Also add SPF and DKIM TXT records they provide to prevent your emails from hitting spam folders.
Step 6: Add Health Check
Route 53 → Health Checks → Create
Name: myapp-production
What to monitor: Endpoint
Protocol: HTTPS
Domain: myapp.com
Path: /api/health
String matching: “healthy”
Now you can link this health check to your A records for automatic failover.
Advanced Tricks I Wish I Knew Earlier
Traffic Flow Visual Editor
Route 53 has a visual editor for complex routing policies. I used it to build a multi-region setup with failover and latency routing. The visual tree makes it way easier than clicking through menus.
Access: Route 53 → Traffic Flow
Cost: $50/month per traffic policy applied. Pricey, but if you’re managing complex global infrastructure, it’s worth it.
Query Logging
You can log all DNS queries to CloudWatch Logs.
Why? I discovered someone was scraping our subdomains by logging queries. Hundreds of requests for admin.myapp.com, staging.myapp.com, internal.myapp.com. We locked those down after seeing the logs.
Setup: Hosted Zone → Query Logging → Configure
Cost: Standard CloudWatch Logs pricing (cheap for most use cases)
DNSSEC for Extra Security
DNS is vulnerable to cache poisoning and man-in-the-middle attacks. DNSSEC adds cryptographic signatures to DNS records.
I enabled it for a fintech client. It’s more complex (key management, chain of trust) but necessary for high-security applications.
Route 53 supports DNSSEC, but honestly, most applications don’t need it unless you’re handling sensitive data.
Route 53 Resolver for Hybrid Cloud
If you have on-premises infrastructure and AWS, Route 53 Resolver lets your on-prem resources query Route 53 private hosted zones, and your AWS resources query your on-prem DNS.
I set this up for a client migrating to AWS gradually. Their legacy systems could resolve new AWS service domains, and new AWS apps could resolve old on-prem service names. Seamless integration during the migration.
Common Mistakes That Cost Me Time
1. Forgetting to Lower TTL Before Migration
Migrated servers, updated DNS, waited for propagation… but old TTL was 86400 seconds (24 hours). Some users were stuck hitting the old server for a full day. Now I always lower TTL to 60 seconds a day before any planned change.
2. Not Testing Health Checks
Set up a health check, thought it was working, it wasn’t. The endpoint required authentication, and Route 53’s checker got 401 errors. The endpoint was marked unhealthy perpetually.
Fix: Create a public health check endpoint (no auth required) that verifies internal systems. Something like /health that returns 200 if everything’s good.
3. Mixing Up Alias and CNAME
Tried to create a CNAME for the root domain. Can’t be done. Wasted 30 minutes debugging before remembering Alias records exist.
Rule: Use Alias for AWS resources and root domains. Use CNAME for everything else.
4. Not Monitoring DNS Query Costs
Route 53 charges $0.40 per million queries (first billion). Sounds cheap, but if you’re getting hammered by bots or scrapers, it adds up. I once got a $200 DNS bill because a badly configured service was making 500 million queries a month to a non-existent subdomain.
Fix: Set up billing alerts and monitor query patterns.
Integration with Other AWS Services
Route 53 plays nicely with the AWS ecosystem:
CloudFront: Point an Alias record to your CloudFront distribution. Instant global CDN for your site.
Elastic Load Balancer: Alias record to your ALB or NLB. DNS automatically resolves to whatever IP AWS assigns your load balancer.
S3 Static Website: Alias record to your S3 website endpoint. Host a static site without servers.
API Gateway: Custom domains for your APIs instead of ugly xyz123.execute-api.us-east-1.amazonaws.com URLs.
Lambda: Combined with API Gateway, route traffic directly to serverless functions.
When NOT to Use Route 53
Honestly? I recommend Route 53 to almost everyone. But there are edge cases:
If you’re 100% on another cloud: GCP has Cloud DNS, Azure has Azure DNS. They integrate better with their respective ecosystems.
If you need Anycast for DDoS protection: Cloudflare’s DNS includes DDoS protection by default. Route 53 doesn’t. For high-risk sites, I use Cloudflare as the public DNS, pointing to Route 53 for internal AWS resources.
If $0.50/month breaks your budget: Cloudflare offers free DNS. For hobbyists, that matters.
But for professional projects, especially on AWS, Route 53 is my default choice.
The Bottom Line
DNS is critical infrastructure. That 6-hour outage I mentioned at the start? Could’ve been avoided entirely with Route 53’s redundancy and health checks.
For $2-5/month, you get enterprise-grade DNS with health monitoring, automatic failover, global routing, and 99.99% uptime. It’s one of the best values in AWS.
If you’re running anything that matters—anything where downtime costs you money, reputation, or sleep—invest the time to set up Route 53 properly. The peace of mind is worth more than the cost.
Set up health checks. Use latency-based or geolocation routing if you’re global. Lower your TTL before migrations. Monitor your query logs.
And for the love of all that’s holy, don’t learn about DNS importance the way I did—with a 6-hour outage and angry customers.


