FIELD NOTES

DNS Failover Setup: How to Keep Your Site Online When Servers Go Down

Understand health checks, DNS answer changes and cache delays when designing failover between hosting endpoints.

Domain: example.com โ†’ A record: 192.0.2.10 โ†’ Web server: IPv4 address
An A record maps a hostname to an IPv4 address. A correct address alone does not prove the website is online.

The named scenario below is a worked example for learning, not a verified incident report. Provider settings and outcomes vary.

DNS Failover Detection Flow

Serving all traffic

Monitor polls server

Primary unresponsive

Switch to backup IP

Traffic rerouted

Users unaffected

๐ŸŽฏ Illustrative example: Akash's E-Commerce Site Survives a Server Crash

Akash's primary server crashes during a sale. DNS failover automatically redirects customers to the backup:

Setup: primary + backup servers

Primary: 10.0.1.1 (main server). Backup: 10.0.2.1 (standby with synced data). Both run the same app.

Health check monitors primary

DNS failover provider pings 10.0.1.1 every 30 seconds. HTTP 200 = healthy.

Primary crashes at 2:00 PM

Server returns HTTP 503. Health check fails 3 consecutive times (90 seconds total).

DNS automatically switches

Failover provider updates A record from 10.0.1.1 to 10.0.2.1. TTL is 60 seconds.

Customers redirected within 2 minutes

New DNS queries return backup IP. Existing connections may need refresh. Sale continues!

Primary fixed, DNS switches back

Once primary recovers and passes health checks, DNS automatically routes back to 10.0.1.1.

Total downtime during server crash: ~2 minutes. Sale lost $0 in revenue.

Without failover, the 4-hour crash would have cost โ‚น3 lakh in lost sales.

What is DNS Failover?

DNS failover is an automated high-availability technique that monitors your server's health and switches DNS records to a backup server when the primary becomes unreachable. Unlike basic DNS round-robin, failover includes active health monitoring โ€” if your server stops responding, traffic is redirected automatically.

This is critical for businesses where downtime means lost revenue. A properly configured DNS failover can reduce effective downtime from hours to under 2 minutes.

How DNS Failover Works

1. Health Checks

The DNS failover provider continuously monitors your primary server by sending HTTP/HTTPS/TCP/ICMP probes at regular intervals (every 10-60 seconds) from multiple global locations.

2. Failure Detection

When health checks fail from multiple locations consecutively (e.g., 3 failures in a row from 2+ regions), the system confirms the primary server is down โ€” not just a network blip.

3. DNS Record Update

The DNS provider automatically changes the A record from the primary IP to the backup server's IP. With a low TTL, clients pick up the new IP within seconds.

4. Recovery (Failback)

Once the primary server recovers and passes health checks again, the DNS record switches back automatically. Some providers offer manual failback for extra control.

TTL Strategy for Failover

TTL is the most critical setting for failover speed. Lower TTL = faster failover but more DNS queries.

TTLFailover TimeDNS Query LoadBest For
30s~1 minVery highCritical production systems
60s~2 minHighE-commerce, SaaS apps
300s~6 minModerateBusiness websites
3600s~1 hourLowNot recommended for failover

DNS Failover Providers

ProviderHealth ChecksMin TTLPricing
AWS Route 5310s interval1s$0.50/health check/month
Cloudflare60s interval30s (proxy)Free (with proxy)
DNS Made Easy30s interval30sFrom $30/year
NS110s interval1sCustom pricing

Common Failover Mistakes

High TTL โ€” Using 3600s TTL means clients won't see the failover for up to an hour. Lower it to 60-300s before enabling failover.

No backup server testing โ€” If your backup isn't configured identically to production, failover may redirect users to a broken site.

Single health check location โ€” A network issue in one region could trigger false failover. Use multi-region health checks.

Forgetting SSL โ€” Your backup server needs a valid SSL certificate for the same domain, or users will see security warnings.

Testing Your Failover

Monitor DNS changes

watch -n 5 'dig yourdomain.com A +short'

Polls every 5 seconds. Simulate failure by stopping your primary server and watch the IP change.

Check current TTL

dig yourdomain.com A | grep -A1 'ANSWER'

mydnsreport.com

Use our DNS Lookup tool to verify your A records and TTL values before and after failover triggers.

Frequently Asked Questions

What is DNS failover?

An automated system that monitors server health and redirects DNS to a backup when the primary fails, minimizing downtime.

How fast does failover happen?

Typically 1-5 minutes depending on health check frequency and TTL. With 30s health checks and 60s TTL, failover completes in ~2 minutes.

Is DNS failover the same as load balancing?

No. Load balancing distributes traffic across active servers. Failover keeps a standby server that only receives traffic when the primary fails.

DNS Round-Robin Load Balancing

Simple load distribution with DNS

DNS TTL Explained

Choose the right TTL for failover

DNS Lookup Tool

Check your A records and TTL

How DNS Works

DNS resolution step by step