Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

Backup & Disaster Recovery

DNS Failover with Route 53 and Azure Traffic Manager

DNS failover moves users to a recovery site by changing which address a name returns. We configure Route 53 failover records with health checks, or Azure Traffic Manager priority routing, tune TTLs, decide automatic or manual cutover and test the switch end to end.

Key takeaways

  • DNS failover is only as good as its health check, so the check must reflect real user experience.
  • TTL and client caching set how quickly traffic actually moves, so plan for a lag.
  • Automatic failover suits stateless tiers; databases usually need a human decision.
  • Failover also needs certificates, data and capacity ready on the other side.
  • Test it, including failback, before it matters.

Having a recovery site is not the same as reaching it

A common disaster recovery surprise: the standby environment is healthy and waiting, yet users still hit the failed primary because nobody can move traffic quickly. The DNS change needs a console login that is behind the broken identity provider. The TTL is a day. The health check tests the wrong thing and either never triggers or flaps constantly.

Traffic management is the last mile of recovery, and it deserves the same design effort as data. It connects the recovery environment to your users, and it is a standard part of our backup and disaster recovery service.

What good looks like

  • Public names resolve to the right place within a measured, known delay.
  • Health checks reflect user experience, with sensible thresholds.
  • The automatic and manual cutover rules are written and agreed.
  • The secondary has valid certificates, capacity and data before traffic arrives.
  • Failover and failback have been exercised.

How it works on AWS

Failover records

Route 53 failover routing uses a pair of records for one name. The primary is tied to a health check; if it fails, Route 53 returns the secondary. In Terraform:

resource "aws_route53_health_check" "primary" {
  fqdn              = "origin-primary.example.com"
  port              = 443
  type              = "HTTPS"
  resource_path     = "/healthz/deep"
  request_interval  = 30
  failure_threshold = 3
}

resource "aws_route53_record" "app_primary" {
  zone_id         = aws_route53_zone.main.zone_id
  name            = "app.example.com"
  type            = "A"
  set_identifier  = "primary"
  health_check_id = aws_route53_health_check.primary.id

  failover_routing_policy {
    type = "PRIMARY"
  }

  alias {
    name                   = aws_lb.primary.dns_name
    zone_id                = aws_lb.primary.zone_id
    evaluate_target_health = true
  }
}

resource "aws_route53_record" "app_secondary" {
  zone_id        = aws_route53_zone.main.zone_id
  name           = "app.example.com"
  type           = "A"
  set_identifier = "secondary"

  failover_routing_policy {
    type = "SECONDARY"
  }

  alias {
    name                   = aws_lb.secondary.dns_name
    zone_id                = aws_lb.secondary.zone_id
    evaluate_target_health = true
  }
}

The domain names are examples. The important detail is the health check path. A shallow /healthz that returns 200 whenever the web process runs will say “healthy” while the database is gone. A deeper check should exercise dependencies that matter, but not so deep that a minor dependency failure triggers a full failover.

Route 53 health checkers probe from the public internet, so private endpoints need a CloudWatch alarm based check. For stricter control over cutover, Route 53 Application Recovery Controller provides routing controls that you flip deliberately, which helps avoid unsafe automatic switching when state is involved. AWS Global Accelerator is another option where fast shifting at the network layer is needed, since it avoids DNS caching, but it applies only to supported endpoint types.

How it works on Azure

Azure Traffic Manager returns DNS answers by a chosen method. For disaster recovery, priority routing lists endpoints in order: all traffic goes to the highest priority healthy endpoint, and falls to the next when monitoring marks it degraded. Monitoring probes a path and port you choose. Like Route 53, Traffic Manager works at the DNS level and does not proxy traffic. For HTTP workloads that need faster, connection-aware failover, Azure Front Door is often a better fit, but it introduces its own dependency and cost.

The TTL reality

Failover completes only when clients ask again. A TTL of 60 seconds sounds quick, yet resolvers and browsers can cache longer, and long-lived connections do not re-resolve at all. You can check what the world sees with:

dig +noall +answer app.example.com
dig +trace app.example.com

We set TTLs low enough for recovery but not so low that DNS cost and resolver load become a problem, and we measure real client convergence in a drill rather than trusting the number on the record. Lowering TTL on the day of a disaster is too late, because the old long TTL is already cached.

Decisions and trade-offs

Automatic or manual. A front end behind a load balancer failing to a warm standby is a fair candidate for automatic failover. If the secondary database is a replica that needs promotion, an automatic DNS switch to an unpromoted database makes things worse. We pair automatic DNS with manual data promotion, or use controlled switches.

Failure of the health check itself. Flapping, or a check that fails because of a network issue between the checker and your site, can move traffic needlessly. Use sensible thresholds, multiple regions of checkers and alarms on the check status.

DNS versus load balancing layers. DNS failover is a coarse tool. Within a region, load balancers handle instance failure. DNS is for site-level failure. Techniques like blue-green deployments use the same routing mechanisms for releases, which is a useful side benefit.

When not to use it. If everything is in one region and the business accepts a manual rebuild, you may not need automated failover. A documented, rehearsed manual switch costs nothing to run.

Common failure modes

  • Secondary certificate expired or missing, so users get errors on the recovery site.
  • Hard-coded endpoints in clients or partners’ allow-lists.
  • DNS provider is itself in the failed region. Keep DNS hosting independent of what you are protecting.
  • Health check calls an endpoint behind authentication.
  • Failback forgotten. Traffic returns before data has been synchronised back.

Testing failover without causing an outage

Failover configuration is notoriously easy to get subtly wrong, and the first real test should not be a real incident. We validate in stages.

  1. Dry run on a test record. Create a non-production hostname with the same health check and routing policy, then fail the primary deliberately and observe the answer change.
  2. Measure the real delay. Record how long it takes from the fault to a client receiving the new answer, including health check detection, record TTL and resolver caching. The slowest part is usually client and resolver behaviour, not the DNS service itself.
  3. Check the secondary under load. Confirm the standby environment can serve production traffic, not just pass a health check. A healthy but undersized standby fails slowly.
  4. Practise failback. Returning traffic is a separate decision. We document when to fail back, and whether to do so manually to avoid flapping between sites.

DNS failover also does not fix data problems. If the standby holds stale or inconsistent data, redirecting users makes things worse, so routing changes are tied to the data steps in your DR environment architecture and runbooks.

Delivery and handover

Records, health checks and alarms are Terraform in your repositories. The runbook for each service includes the cutover and failback steps, access paths that do not depend on the failed region, and a measured convergence time. Our ingress and platform work ensures clusters expose the health endpoints these checks need.

How to tell it is working

Health checks are green in normal operation and have never flapped without cause. A drill moves test traffic to the secondary and back, with the measured time written in the runbook. To design failover for your public endpoints, contact us.

References

How we deliver it

  1. 01

    Map entry points

    We list every public name, API endpoint and integration that users or partners reach, with the current TTL and owner.

  2. 02

    Design health checks

    Checks test a path that proves the application works end to end, not just that a load balancer answers.

  3. 03

    Configure the records

    Primary and secondary records, alias targets and routing policies are created as code with sensible TTLs.

  4. 04

    Choose automatic or manual

    Each service gets a rule for when traffic fails over on its own and when a person decides, to avoid unsafe switches.

  5. 05

    Prepare the recovery side

    Certificates, WAF rules, capacity, data and allow-lists are verified on the secondary before traffic arrives.

  6. 06

    Test and rehearse

    We run a real failover and failback, measure how long clients take to move, and record the result.

Tools and technologies

Amazon Route 53Route 53 health checksRoute 53 Application Recovery ControllerAzure Traffic ManagerAzure Front DoorAWS Global AcceleratorAmazon CloudWatchAWS Certificate ManagerTerraformdig

Frequently asked questions

How does Route 53 failover work?
You create a primary and a secondary record for the same name. Route 53 health checks monitor the primary, and when it is unhealthy Route 53 starts answering queries with the secondary. Clients then reach the recovery site once their cached answer expires.
How fast is DNS failover?
It depends on health check settings, the record TTL and client resolvers. Detection takes a few check intervals, then caches must expire. In practice you should assume minutes, not seconds, and some clients cache longer than the TTL. Measure it in a drill.
What is the difference between Route 53 and Azure Traffic Manager?
Both are DNS-based traffic routing services. Route 53 is AWS's DNS with health checks and routing policies. Traffic Manager is Azure's DNS-based load balancer using priority, weighted and other methods with endpoint monitoring. Neither proxies traffic, so both rely on DNS caching behaviour.
Should failover be automatic?
For stateless web tiers with healthy replicas, yes, often. For anything that involves promoting a database or risks split-brain writes, a human decision is safer. Many teams automate DNS for the front end and keep data promotion manual.
Can DNS failover work for private resources?
Route 53 health checkers are on the public internet, so they cannot probe private endpoints directly. For private resources you use a CloudWatch alarm based health check or an internal signal. Azure Traffic Manager similarly monitors public endpoints.

Talk to an engineer about route 53 failover

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-08.