Opscraft
Route 53 routing policies · Lesson 1 of 10 · 4 min read

How routing policies work

Route 53 routing policies decide which answer a DNS query gets: split traffic by weight, send users to the lowest-latency region, fail over to a standby, route by the user's country or network. Combined with health checks, they're the backbone of multi-region and disaster-recovery designs on AWS. Senior interviews expect you to know all eight policies, how health checks drive them, how to nest policies for real architectures, and — crucially — the limits of DNS-based traffic management.

Record sets with set identifiers

A simple record is one record set per name and type. Every other policy works by creating several record sets with the same name and type, each with:

  • a set identifier (a unique label like mumbai or blue),
  • policy-specific settings (weight, region, failover role, location, CIDR collection...),
  • optionally a health check (or evaluate_target_health for alias records).

Route 53 evaluates the policy for each query and returns the chosen record set's values. You can't mix routing policies for the same name and type at one level — you nest them using alias records (later lesson).

Enlarge diagramSAME NAME, SAME TYPEqueryapp.example.comAset-id: blueweight 90 · alias → ALB blueset-id: greenweight 10 · alias → ALB greenpolicy picks one
Figure 1. Every policy except simple works the same way: several records with the same name and type, each with a set identifier and its own settings.
Swipe sideways to see all of it, or tap to open it full screen.

The eight policies

Policy Chooses answer by Health checks Typical use
Simple Nothing — one record set (may contain multiple values) No Single resource
Weighted Relative weights Yes Gradual migrations, A/B, DNS-level canary
Latency Lowest latency between the user's network and AWS regions Yes Multi-region active-active
Failover Primary if healthy, else secondary Required on primary Active-passive DR
Geolocation User's continent, country, or US state Yes Compliance, localisation, licensing
Geoproximity Geographic distance, adjustable with bias Yes Shifting regional boundaries; via Traffic Flow
Multivalue answer Returns up to 8 healthy values at random Yes (per value) Client-side load spreading with health filtering
IP-based Client's source IP range (CIDR collections) Yes ISP/office-specific routing
Enlarge diagramSimpleone answerWeightedsplit by percentageLatencyclosest AWS regionFailoverprimary, else secondaryGeolocationby the user's countryGeoproximityby distance, with biasIP-basedby the user's networkMultivalueup to 8 healthy IPs
Figure 2. Each routing policy answers a different question about which record to return.
Swipe sideways to see all of it, or tap to open it full screen.

Health checks + evaluate target health

  • A non-alias record gets a health_check_id. If that health check is unhealthy, Route 53 treats the record as unavailable and picks another per the policy.
  • An alias record can set evaluate_target_health = true: Route 53 uses the health of the target itself (e.g. an ALB is unhealthy if no healthy targets in its target groups; for nested aliases, the health of the nested record set). No separate health check needed — and no extra cost.
  • If all records in a policy are unhealthy, Route 53 returns all of them anyway (fail-open) rather than nothing — better than an outage due to a misconfigured check.
Enlarge diagramSome records unhealthyAll records unhealthyUnhealthy records are skippedTheir share goes to the healthy onesAlias records can use the target's health(evaluate_target_health)Route 53 fails open: returns them all anywayBetter than answering nothingA broken health check can hide real outages, sotest checks too
Figure 3. How health decides what Route 53 returns, and the safety net when everything looks unhealthy.
Swipe sideways to see all of it, or tap to open it full screen.

TTL is always in play

Whatever Route 53 decides, clients act on cached answers until the TTL expires. Routing changes and failovers therefore take effect gradually. Keep TTLs low (~60 s) on records used for failover or traffic shifting; aliases to ELBs already use 60 s.