Opscraft
Route 53 routing policies · Lesson 6 of 10 · 3 min read

Geolocation, geoproximity and IP-based routing

Geolocation

Route by the user's location (determined from the resolver IP or EDNS client subnet): continent, country, or US state (and some subdivisions).

set-id india    A alias → ap-south-1 ALB      location: country IN
set-id europe   A alias → eu-central-1 ALB    location: continent EU
set-id default  A alias → us-east-1 ALB       location: Default (*)
  • The most specific match wins (US state > country > continent).
  • Always create a Default record — otherwise users from unmapped locations (or whose location can't be determined) get no answer (NOERROR, empty).
  • Use cases: data residency/compliance (EU users must be served from EU), content localisation, licensing restrictions, routing an entire country to a specific stack.
  • Geolocation isn't latency — an Indian user is sent to the India record even if another region happened to be faster.

Geoproximity (Traffic Flow)

Routes by distance between the user and your resources (AWS regions or latitude/longitude for non-AWS resources), with a bias from −99 to +99 per resource:

  • Positive bias expands a resource's area so it attracts more traffic; negative shrinks it.
  • Example: give ap-south-1 a +50 bias so it also serves parts of the Middle East that would otherwise go to me-south-1.

Geoproximity is configured in Traffic Flow policies (and now also directly as a record routing policy).

IP-based routing

Route by the client's IP range: upload CIDR collections (e.g. an ISP's ranges, your offices, a big customer's egress IPs) and map each CIDR location to a record.

  • Use cases: send a specific ISP's customers to an edge or region you know performs best for them; route a SaaS customer's office ranges to a dedicated stack; fine-grained control where geo/latency data isn't good enough.
  • Uses the resolver IP or EDNS client subnet, like other location-based policies.

Latency vs geolocation in one line

Latency picks the fastest region for the user's network; geolocation picks by where the user is, for compliance or content, regardless of speed.

Enlarge diagramLatency routingGeolocation routingGoal: speedA German user may get Frankfurt or LondonAnswers can change as latency data changesGoal: rules about place (data residency,language)A German user always gets the EU stackAdd a default record for unmatched locations
Figure 1. Latency vs geolocation in one picture: latency picks the fastest region; geolocation picks by where the user is, for law, language or licensing.
Swipe sideways to see all of it, or tap to open it full screen.