aws #route53 #dns #networking
AWS Route 53 Routing Policies Explained
INTRO
Route 53 is AWS's DNS service. When someone types www.example.com into their browser, Route 53 is what decides which server or IP address that request actually gets sent to.
A routing policy is simply the rule Route 53 follows to answer one question:
"Which server or location should this user be sent to?"
There are eight routing policies, and each one answers that question a different way. Let's go through them one at a time.
1. SIMPLE ROUTING POLICY
The most basic option. You have one domain, myapp.com, and one server, 10.0.0.1. Route 53 sends every single user to that same server.
User → myapp.com → Server 1
Use this when you only have one server and don't need any special routing logic at all.
Easy way to remember it: "Send everyone to the same place."
2. WEIGHTED ROUTING POLICY
Here, traffic is split across servers based on a percentage/weight you assign.
Server 1 → Weight 80
Server 2 → Weight 20
Out of 100 users, roughly 80 land on Server 1 and 20 land on Server 2.
Real example: You're testing a new version of your app. You send 90% of traffic to the old version and 10% to the new one:
Users
↓
Route 53
↙ ↘
90% 10%
Old New
If the new version holds up well, you can gradually shift the split to 50/50, then eventually 100% new version.
Easy way to remember it: "Divide traffic by percentage."
3. LATENCY ROUTING POLICY
Route 53 sends the user to whichever server gives them the lowest latency — the fastest response time.
Pakistan → Karachi
USA → Virginia
Europe → Frankfurt
A user connecting from Pakistan would generally be routed to the Karachi endpoint, if that's the server offering the lowest latency for them:
Pakistan User
↓
Route 53
↓
Karachi Server
A user in the USA gets routed differently:
USA User
↓
Route 53
↓
Virginia Server
Easy way to remember it: "Send the user to whichever server is fastest for them."
4. FAILOVER ROUTING POLICY
This one exists for backup servers.
Primary Server → Working
Secondary Server → Backup
Normally, all traffic goes to the primary:
User → Primary Server
But if a health check detects the primary is down, traffic automatically shifts:
Primary ❌
↓
Route 53
↓
Secondary ✅
Real example: Your main website server is in Karachi. Your backup server sits in Singapore. If the Karachi server goes down, Route 53 automatically starts sending users to the Singapore server instead.
Easy way to remember it: "Primary down? Send them to the backup."
5. GEOLOCATION ROUTING POLICY
This routes users based on their actual location.
Pakistan user → Pakistan server
USA user → USA server
UK user → UK server
Say you run example.com and you want:
- Pakistani users to see the Pakistan-specific site
- US users to see the US-specific site
Geolocation routing is exactly built for that.
Important distinction:
- Latency picks whichever server is fastest, regardless of where the user actually is
- Geolocation picks a server based on the user's country, regardless of which one is technically fastest
Easy way to remember it: "Where is the user coming from?"
6. GEOPROXIMITY ROUTING POLICY
This is also location-based, but here you can actually adjust the size of the geographic area each server covers.
Say you have:
AWS Lahore
AWS Singapore
You could decide that most of Pakistan's traffic should go to Lahore, while Singapore and nearby regions go to the Singapore server. You can also apply a bias — for example, if you want the Lahore server to cover a larger geographic area than it normally would, you increase its bias to expand its coverage zone.
Easy way to remember it: "Control the geographic boundary to steer traffic."
7. MULTIVALUE ANSWER ROUTING POLICY
Here, Route 53 can return multiple healthy IP addresses in a single response instead of just one.
Server 1 → 10.0.0.1
Server 2 → 10.0.0.2
Server 3 → 10.0.0.3
Route 53's DNS response might include all three:
DNS Response:
10.0.0.1
10.0.0.2
10.0.0.3
The client then picks one of those addresses to actually connect to. If health checks are enabled, any unhealthy endpoint gets excluded from that list automatically.
Easy way to remember it: "Return several healthy server IPs instead of just one."
8. IP-BASED ROUTING POLICY
This routes traffic based on the user's source IP address.
User IP: 10.x.x.x → Server A
User IP: 20.x.x.x → Server B
You can map specific IP ranges directly to specific endpoints.
Simple example:
Company employees' IP range → Internal Server
Everyone else → Public Server
That's a good fit for IP-based routing.
Easy way to remember it: "Check the user's IP, then route accordingly."
QUICK REFERENCE TABLE
| Policy | Simple meaning | Example |
|---|---|---|
| Simple | Everyone gets the same server | Everyone → Server A |
| Weighted | Split by percentage | 80% → A, 20% → B |
| Latency | Fastest/lowest-latency server | Pakistan → Karachi |
| Failover | Primary down → backup takes over | A ❌ → B |
| Geolocation | Based on the user's location | Pakistan → Pakistan server |
| Geoproximity | Based on geographic area/bias | Lahore gets a larger coverage area |
| Multivalue | Returns multiple healthy IPs | A + B + C |
| IP-based | Based on the user's source IP | IP range A → Server A |
SHORTCUT FOR REMEMBERING THESE
- Simple = Same
- Weighted = Percentage
- Latency = Fastest
- Failover = Backup
- Geolocation = Where the user is
- Geoproximity = Geographic area control
- Multivalue = Multiple IPs
- IP-based = User's IP
If you're studying this for an AWS exam, the distinction between Latency vs. Geolocation vs. Geoproximity is the one worth spending the most time on — they all sound similar but solve genuinely different problems.
Top comments (0)