0Pricing
AWS Solutions Architect · Lesson

Health Checks and DNS Failover

Set up endpoint, calculated, and CloudWatch alarm health checks so Route 53 automatically routes traffic away from unhealthy endpoints.

Health Checks and DNS Failover is a free AWS Solutions Architect lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Are Route 53 Health Checks?

Route 53 health checks continuously monitor the health of your endpoints—web servers, load balancers, or any HTTP/HTTPS/TCP endpoint accessible on the internet. Based on health check results, Route 53 can automatically update DNS routing to avoid sending traffic to unhealthy resources.

Health checks are billed per health check per month. Route 53 global health checkers (located in multiple Regions) probe your endpoint simultaneously, providing redundancy in the health checking itself. An endpoint is considered unhealthy only when a threshold number of checkers agree it has failed.

Endpoint Health Checks

Endpoint health checks monitor a specific IP address or domain name with your chosen protocol (HTTP, HTTPS, or TCP), port, and optional path. For HTTP/HTTPS checks, Route 53 verifies that the endpoint returns a 2xx or 3xx HTTP status code within the timeout period. For HTTPS checks, it optionally validates the TLS certificate.

Key configuration options: request interval (10 or 30 seconds—10 seconds is faster detection but costs more), failure threshold (1–10 consecutive failures before marking unhealthy), and string matching (optionally verify the response body contains a specific string).

# Create an HTTP health check
aws route53 create-health-check \
  --caller-reference hc-2026-06-20 \
  --health-check-config '{
    "Type": "HTTP",
    "IPAddress": "54.100.1.1",
    "Port": 80,
    "ResourcePath": "/health",
    "FailureThreshold": 3,
    "RequestInterval": 30
  }'

Calculated Health Checks

Calculated health checks combine the results of multiple child health checks using Boolean logic (AND, OR, NOT). They enable you to define application-level health based on multiple signals without creating complex routing chains.

Example: a web application is healthy only if both the API server check AND the database check pass. Create a calculated health check with type AND that references both endpoint checks. If either fails, the calculated health check fails and Route 53 removes the associated DNS record from responses.

# Create a calculated health check (AND of two child checks)
aws route53 create-health-check \
  --caller-reference hc-calc-2026 \
  --health-check-config '{
    "Type": "CALCULATED",
    "ChildHealthChecks": [
      "hc-api-id",
      "hc-db-id"
    ],
    "HealthThreshold": 2
  }'

CloudWatch Alarm Health Checks

CloudWatch alarm health checks link a Route 53 health check to the state of a CloudWatch alarm. If the alarm is in the ALARM state, the health check is marked unhealthy; if OK or INSUFFICIENT_DATA, it is marked healthy.

This pattern is powerful for endpoints inside a VPC (which cannot be reached by Route 53's external health checkers). Instead of probing the private endpoint, you create CloudWatch metrics and alarms for it, then base the Route 53 health check on the alarm state. This also enables health checking based on business metrics like error rate or queue depth.

# Create a health check based on a CloudWatch alarm
aws route53 create-health-check \
  --caller-reference hc-cw-2026 \
  --health-check-config '{
    "Type": "CLOUDWATCH_METRIC",
    "AlarmIdentifier": {
      "Region": "us-east-1",
      "Name": "HighErrorRate-Alarm"
    },
    "InsufficientDataHealthStatus": "Healthy"
  }'

Private Endpoint Health Checks

Route 53 health checkers are AWS-managed servers outside your VPC that reach endpoints over the public internet. Resources in private subnets are unreachable by standard endpoint health checks. For private endpoints, use one of these approaches:

  • Publish a custom CloudWatch metric from inside the VPC (e.g., a success/fail signal from the application), create an alarm, and use a CloudWatch alarm health check
  • Use a CloudWatch composite alarm that aggregates ELB, RDS, or application metrics inside the VPC

This pattern is critical for private-subnet databases, internal load balancers, and backend services.

Health Check Status and Monitoring

You can view health check status in the Route 53 console under Health Checks or query it via the API. Route 53 publishes health check metrics to CloudWatch in the AWS/Route53 namespace, including HealthCheckStatus (1 = healthy, 0 = unhealthy) and HealthCheckPercentageHealthy (percentage of Route 53 checkers that report the endpoint as healthy).

Set up CloudWatch alarms on HealthCheckStatus to receive SNS notifications when an endpoint goes unhealthy, giving you visibility before your on-call team notices the DNS failover has already occurred.

# Get health check status
aws route53 get-health-check-status \
  --health-check-id a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --query 'CheckerIpRanges'

DNS Failover with Failover Routing

When Route 53 detects that a Primary record's health check has failed, it removes the Primary from DNS responses and returns the Secondary's address. This is called DNS failover. The switch occurs within the evaluation period (number of health checker failures × request interval) plus the TTL of the record.

Example: request interval = 30 s, failure threshold = 3, TTL = 60 s. Worst-case failover time ≈ 3 × 30 + 60 = 150 seconds. Setting a lower TTL (e.g., 10 seconds) and faster health check interval (10 s) can reduce this to 3 × 10 + 10 = 40 seconds.

Health Checks for Weighted and Latency Records

Health checks can be associated with Weighted and Latency records too, not just Failover records. When a Weighted record's health check fails, Route 53 redistributes that record's traffic weight proportionally among healthy weighted records. When a Latency record's health check fails, Route 53 routes queries to the next-lowest-latency healthy record.

This makes Weighted and Latency routing policies resilient to endpoint failures without requiring explicit Failover records. It is a common SAA-C03 pattern: Latency routing across Regions with health checks provides both performance optimisation and automatic disaster recovery.

Active-Active Multi-Region with Health Checks

A resilient multi-region active-active pattern using Route 53:

  1. Create Latency records for each Region (us-east-1, eu-west-1, ap-southeast-1), each with a health check
  2. When all Regions are healthy, users are routed to the lowest-latency Region
  3. If one Region's health check fails (application down or unresponsive), Route 53 automatically removes it from DNS responses and routes queries to the next-best healthy Region
  4. When the failed Region recovers, health check passes and Route 53 reintroduces it into the rotation

This provides automatic global failover with performance optimisation—no manual intervention required.

IP Ranges for Route 53 Health Checkers

Route 53 health checkers originate from a set of published IP ranges in the ROUTE53_HEALTHCHECKS section of the AWS IP ranges JSON file. If your endpoint is protected by a firewall or security group that restricts inbound access, you must allow traffic from these IP ranges for health checks to succeed.

Alternatively, use a public-facing endpoint that proxies to your private backend (such as an ALB) for health checking. The ALB's security group only needs to allow Route 53 IP ranges, while the backend's security group only allows the ALB security group—maintaining a defence-in-depth approach.

# Fetch Route 53 health checker IP ranges
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | \
  python3 -c "
import json,sys
data=json.load(sys.stdin)
ranges=[p['ip_prefix'] for p in data['prefixes'] if p['service']=='ROUTE53_HEALTHCHECKS']
print('\n'.join(ranges))
"

Health Check Best Practices

Best practices for Route 53 health checks:

  • Create a dedicated /health endpoint that checks all critical dependencies (database connectivity, cache reachability) and returns 200 only when fully operational
  • Use a 10-second request interval for critical production endpoints to detect failures faster
  • Monitor HealthCheckPercentageHealthy in CloudWatch—a partial failure (some but not all Route 53 checkers failing) may indicate a regional network issue or intermittent problem
  • For VPC-private resources, use CloudWatch alarm health checks based on application metrics
  • Test failover in non-production environments before relying on it in production

Quick Check

Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.

Lesson Recap

In this lesson you learned: endpoint health checks probe HTTP/HTTPS/TCP from external Route 53 checkers, CloudWatch alarm health checks enable monitoring of private VPC resources, and calculated health checks combine multiple signals with Boolean logic. DNS failover speed depends on health check interval, failure threshold, and TTL. Next up we explore CloudFront distributions and origins.

Frequently asked questions

Is the “Health Checks and DNS Failover” lesson free?

Yes — the full text of “Health Checks and DNS Failover” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.

What will I learn in “Health Checks and DNS Failover”?

Set up endpoint, calculated, and CloudWatch alarm health checks so Route 53 automatically routes traffic away from unhealthy endpoints. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Solutions Architect?

No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Health Checks and DNS Failover” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Solutions Architect lesson?

Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

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