0PricingLogin
AWS Solutions Architect · Lesson

Failover and Geolocation Routing

Configure active-passive failover with health checks and restrict or customise responses by the geographic origin of queries.

Failover Routing Overview

Failover routing implements an active-passive configuration: one record is designated Primary and another is Secondary. Route 53 always returns the Primary record as long as its health check passes. If the Primary becomes unhealthy, Route 53 automatically switches to returning the Secondary record.

Failover routing is the go-to pattern for disaster recovery scenarios where you have a production environment (primary) and a standby environment (secondary) that should only receive traffic when the primary is down.

Configuring Failover Records

To set up failover routing, create two records with the same DNS name: one with Failover=PRIMARY and one with Failover=SECONDARY. Attach a health check to the Primary record. The Secondary record should also have a health check if it points to a resource that could fail independently.

The Secondary record acts as a static fallback—it can point to an S3 static website, a maintenance page, or a scaled-down standby environment. Even if the Secondary has no health check, Route 53 always falls back to it when the Primary fails.

# Create primary failover record
aws route53 change-resource-record-sets \
  --hosted-zone-id Z1234567890 \
  --change-batch '{
    "Changes": [{
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "app.example.com",
        "Type": "A",
        "SetIdentifier": "primary",
        "Failover": "PRIMARY",
        "TTL": 60,
        "ResourceRecords": [{"Value": "54.100.1.1"}],
        "HealthCheckId": "hc-primary-id"
      }
    }]
  }'

All lessons in this course

  1. Hosted Zones and DNS Record Types
  2. Routing Policies: Simple, Weighted, and Latency
  3. Failover and Geolocation Routing
  4. Health Checks and DNS Failover
← Back to AWS Solutions Architect