Stop 08 · DNS, CDN & Edge ServicesTopics · 3/7

Amazon Route 53 Routing Policies

Part of the AWS Roadmap

In short

One domain doesn't have to give everyone the same answer. Routing policies let Route 53 send users to the nearest Region, split traffic for a test or fall back to a backup.

Route 53 routing policies decide which answer a DNS query gets: simple, weighted for splitting traffic, latency-based for the nearest Region, failover for active-passive setups, geolocation and geoproximity for location rules, and multivalue answer.

The jaadu, in a traffic constable's white gloves on a raised platform, waves some cars left, some right and a few onto a brand new flyover.

Think of it like this

The traffic constable at the junction

At a busy Pune junction, a constable doesn't wave every car the same way. He sends trucks to the bypass, sends most cars straight and a few down the new flyover to test it, and if one road is blocked he diverts everyone. Route 53 routing policies are that constable for DNS answers.

Watch it happen

Which policy fits?

What do you need?
One resource
Split by percentage
Fastest Region
Backup if down
By user location
Simple
Weighted
Latency
Failover
Geolocation / Geoproximity

1/6Start from the requirement, not the policy name.

The big ideas

What you need to know

Weighted

Each record gets a weight. Route 53 answers in proportion, so weights 9 and 1 send about 90% and 10%. Weight 0 stops traffic to a record.

Latency

You create one record per Region. Route 53 answers with the Region that has the lowest latency for that user's resolver.

Geolocation vs geoproximity

Geolocation matches the user's continent, country or state. Geoproximity routes by distance and lets you widen or shrink a Region's area with a bias.

Multivalue answer

Returns up to eight healthy records at random. It spreads load a little, but it is not a replacement for a load balancer.

See it in code

Walk through the code

json
1{2  "Changes": [3    {4      "Action": "UPSERT",5      "ResourceRecordSet": {6        "Name": "api.priyabakes.in",7        "Type": "CNAME",8        "SetIdentifier": "stable-v1",9        "Weight": 90,10        "TTL": 60,11        "ResourceRecords": [{ "Value": "v1-alb-123.ap-south-1.elb.amazonaws.com" }]12      }13    },14    {15      "Action": "UPSERT",16      "ResourceRecordSet": {17        "Name": "api.priyabakes.in",18        "Type": "CNAME",19        "SetIdentifier": "canary-v2",20        "Weight": 10,21        "TTL": 60,22        "ResourceRecords": [{ "Value": "v2-alb-456.ap-south-1.elb.amazonaws.com" }]23      }24    }25  ]26}

1/4Same name and same type in both records. That's what makes them one weighted set.

A change batch for weighted routing, applied with aws route53 change-resource-record-sets. Two records share one name and type.

Save yourself the pain

Common mistakes

Oops

Expecting weighted routing to split exactly 90/10 per request.

Do this instead

Resolvers cache answers for the TTL, so the split is approximate. For exact per-request splits, use ALB weighted target groups.

Oops

Using geolocation records without a default record.

Do this instead

Add a Default location record, or users from places you didn't list get no answer at all.

Your mission

Plan routing for a two-Region app

~15 min

Quick check

You want users to reach whichever Region responds fastest for them. Which policy?

Go deeper

  1. 1Create two weighted records that send 90% and 10% of traffic to different endpoints.
  2. 2Match each routing policy to a real use case such as a canary release.
  3. 3Read how TTL affects how quickly routing changes reach users.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge