
August 29, 2026
11 min read
Table of Contents
By Kokil Thapa | Last reviewed: August 2026
When your application runs on more than one cloud provider, the hardest part is not deploying twice—it is deciding which backend gets each request. Cross-Cloud DNS and Traffic Routing puts that decision at the DNS layer: one authoritative zone, multiple origin targets, health-aware failover, and geo or latency rules that send users to the closest healthy stack. If you already split workloads across AWS and a VPS, or you are planning a multi-cloud architecture, DNS is the control plane that ties the clouds together without rewriting your application.
What Is Cross-Cloud DNS and Traffic Routing?
Cross-cloud DNS means one domain name resolves to origins hosted in different providers. Traffic routing is the policy layer on top: weighted round-robin, latency-based selection, geolocation steering, or active-passive failover. You are not load-balancing inside one VPC—you are orchestrating which cloud receives public HTTP, API, or mail traffic at query time.
In practice, most teams I work with do not start with five clouds on day one. They begin with a primary stack—say Laravel on EC2 with RDS—and add a secondary origin on DigitalOcean or Hetzner for disaster recovery, cost arbitrage, or regional presence. DNS becomes the switchboard. When the primary health check fails, the record flips to the secondary without users changing URLs.
The pattern differs from putting a CDN in front of one origin. With cross-cloud routing, each origin can live on a different ASN, billing account, and certificate chain. Your DNS provider becomes part of your reliability story—right alongside disaster recovery planning.
Core components you need
- Authoritative DNS — Cloudflare, Amazon Route 53, Azure DNS, Google Cloud DNS, or NS1/DNS Made Easy with traffic-steering features.
- Health monitoring — HTTP(S) probes against
/healthor TCP checks on port 443; intervals of 30–60 seconds are typical. - Origin endpoints — Public IPs, load balancer hostnames, or CNAME targets per cloud.
- Low TTL during cutovers — 60–300 seconds while migrating; raise to 3600+ once stable.
- Runbook for manual override — DNS automation fails; you need a documented way to pin traffic manually.
How Does DNS Resolution Work in a Multi-Cloud Setup?
When a user requests app.example.com, the resolver chain matters. The browser asks the OS stub resolver, which queries the ISP or public resolver (1.1.1.1, 8.8.8.8). That recursive resolver walks the DNS hierarchy: root → TLD (.com) → your authoritative nameservers. Only then does your routing policy execute.
Cached answers are the silent killer during failover. If your TTL is 86400 seconds and AWS goes down, a slice of users keep hitting a dead IP for a day. During any migration or DR test, drop TTL to 60 seconds at least 24 hours before the event. After validation, increase gradually.
Proxied setups—Cloudflare orange-cloud, AWS CloudFront—add another hop. The user resolves to the proxy edge, and the proxy origin-pulls from your cloud backend. That is still cross-cloud routing, but health checks must target the path the proxy uses, not only the public IP behind it.
Which DNS Routing Policies Should You Use Across Clouds?
Each major provider names policies differently, but the concepts repeat. Pick the simplest policy that meets your SLO; complexity increases blast radius when someone mis-clicks a weight in a dashboard at 2 a.m.
| Policy | Best for | Example | Watch out for |
|---|---|---|---|
| Active-passive failover | DR standby, cost control | Primary AWS; Hetzner standby on health failure | Standby must be warm—DB replication lag matters |
| Weighted round-robin | Canary releases, gradual migration | 90% old cloud / 10% new cloud | Sticky sessions break if app state is local |
| Geolocation | Data residency, latency | EU users → Azure West Europe; APAC → AWS Singapore | VPN users get wrong region |
| Latency-based | Global SaaS without strict residency | Route 53 latency records to nearest healthy region | Needs healthy endpoints in multiple regions |
| Multi-value / round-robin A | Simple load spread | Two A records, equal weight | No automatic failover without health checks |
For Nepal-facing business sites, geolocation often sends South Asia traffic to Singapore or Mumbai regions rather than US-East. That choice affects TTFB more than micro-optimising Blade templates. Pair region selection with guidance on choosing the right AWS region for latency and compliance.
When active-active makes sense
Active-active across clouds only works if your app tolerates split-brain: shared database or async replication, stateless web tier, idempotent writes, and conflict resolution you have actually tested. Most Laravel client portals I maintain run active-passive—primary on EC2, cold or warm standby elsewhere—because dual-write MySQL across clouds without a managed global database is operationally expensive for a small team.
How Do You Configure Cross-Cloud DNS with Route 53 and Cloudflare?
Two stacks dominate production: AWS-native Route 53 with health-checked failover records, and Cloudflare as authoritative DNS with Load Balancing pools. Both support cross-cloud origins; the choice often comes down to whether you already pay for Cloudflare Pro/Business for WAF and CDN.
Amazon Route 53 failover pair
Route 53 health checks probe an endpoint every 30 seconds from multiple global locations. A failed check marks the record unhealthy and promotes the secondary.
# Terraform — Route 53 failover for app.example.com
resource "aws_route53_health_check" "primary" {
fqdn = "primary.example.com"
port = 443
type = "HTTPS"
resource_path = "/health"
failure_threshold = 3
request_interval = "30"
}
resource "aws_route53_record" "primary" {
zone_id = aws_route53_zone.main.zone_id
name = "app"
type = "A"
ttl = 60
records = [aws_eip.primary.public_ip]
set_identifier = "primary-aws"
failover_routing_policy {
type = "PRIMARY"
}
health_check_id = aws_route53_health_check.primary.id
}
resource "aws_route53_record" "secondary" {
zone_id = aws_route53_zone.main.zone_id
name = "app"
type = "A"
ttl = 60
records = [var.hetzner_standby_ip]
set_identifier = "secondary-vps"
failover_routing_policy {
type = "SECONDARY"
}
} Your /health endpoint should verify dependencies—not return 200 because PHP-FPM responds while MySQL is down. On production Laravel apps, I return 503 if the database connection or Redis ping fails.
Cloudflare Load Balancing pools
Cloudflare pools group origins; monitors attach to each pool. Traffic steering rules pick the pool by geo, random, or dynamic latency.
# Cloudflare API — create origin pool (curl example)
curl -X POST "https://api.cloudflare.com/client/v4/user/load_balancers/pools" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"name": "aws-primary-pool",
"origins": [
{"name": "aws-alb", "address": "primary-alb-123.ap-southeast-1.elb.amazonaws.com"}
],
"monitor": "monitor-id-health-check",
"enabled": true
}' Cloudflare proxied records hide origin IPs—a security win—but you must allow Cloudflare IP ranges on your AWS security groups and Azure NSGs. See Cloudflare CDN setup and best practices for the full allowlist workflow.
Azure Traffic Manager as a secondary layer
Some enterprises use Azure Traffic Manager for Microsoft-centric workloads while Route 53 handles public marketing sites. Avoid chaining too many CNAME hops; each adds latency and debugging pain. Prefer one authoritative steering layer per hostname.
- Register nameservers at your registrar pointing to the chosen authoritative provider.
- Create health checks against real application paths, not static
index.html. - Define primary and secondary records with distinct set identifiers.
- Lower TTL, deploy, run a controlled failure test (stop primary web tier).
- Measure failover time; adjust health check thresholds if flapping occurs.
- Document manual DNS override steps for registrar or API access.
What Are the Common Failures in Cross-Cloud Traffic Routing?
DNS routing looks simple until production teaches you otherwise. These failures recur on client projects and sister-site deployments I maintain on shared EC2 infrastructure.
Certificate and hostname mismatches
Each origin needs a valid TLS certificate for the hostname users type. A standby VPS with a self-signed cert fails HTTPS health checks even if the app runs fine. Use Let's Encrypt on every origin, or terminate TLS at Cloudflare and use origin certificates.
Split-horizon and stale caches
Corporate DNS filters and old ISP caches ignore your low TTL. Test failover from an external vantage—dig @8.8.8.8 app.example.com and dig @1.1.1.1 app.example.com—not only from your laptop on office Wi-Fi.
Database lag on failover
Promoting DNS to a standby cloud while MySQL replication lags 20 minutes means users see old data or write errors. DNS failover is not database failover. Automate or rehearse DB promotion separately, and align RPO/RTO with what DNS cutover actually gives you.
Health-check flapping
Aggressive thresholds during deploys cause oscillation: primary marked unhealthy mid-deploy, traffic hits cold standby, primary recovers, traffic shifts back. Exclude maintenance windows, use connection draining on load balancers, or temporarily disable health checks during controlled releases.
DNS failover gets you to a server. It does not fix inconsistent data, session loss, or payment webhooks still pointing at the old IP. Treat routing as one layer in a full DR plan.
How Do You Manage Cross-Cloud DNS as Infrastructure as Code?
Manual DNS edits do not survive team turnover. Store records in Terraform or OpenTofu, review changes in CI, and keep state in a remote backend. For multi-provider DNS, split modules per zone but one state file per environment to avoid partial applies.
# terraform/modules/dns/main.tf — weighted migration example
resource "cloudflare_load_balancer" "app" {
zone_id = var.zone_id
name = "app.example.com"
default_pool_ids = [cloudflare_load_balancer_pool.aws.id]
fallback_pool_id = cloudflare_load_balancer_pool.vps.id
session_affinity = "cookie"
steering_policy = "dynamic_latency"
}
resource "cloudflare_load_balancer_pool" "aws" {
name = "aws-pool"
origins {
name = "aws-origin"
address = var.aws_origin_hostname
enabled = true
}
monitor = cloudflare_load_balancer_monitor.https.id
} Pin provider versions—Cloudflare and AWS provider APIs change. Track DNS drift: if someone edits in the console, your next Terraform plan should fail until reconciled. Pair this with guidance from managing multi-cloud state with Terraform and global load balancing across cloud providers for larger footprints.
Operational checklist before go-live
- Run failover drill quarterly; measure actual RTO including DNS cache.
- Alert on health-check state changes via PagerDuty, Slack, or email—Route 53 and Cloudflare both support notifications.
- Keep registrar credentials and API tokens in a secrets manager, not a shared spreadsheet.
- Log DNS changes; correlate with deployment timestamps when debugging mystery outages.
- For Nepal-based teams on limited budgets, a Rs 3,000–5,000/month (~USD 22–37) Cloudflare Load Balancing add-on plus a cheap Hetzner standby often beats building custom anycast.
Cross-cloud networking underneath—VPN or private links between VPCs and Azure VNets—is separate from public DNS routing. If backends must talk privately, plan that with AWS-to-GCP networking or hub-and-spoke patterns before you publish split-horizon records.
How Should You Plan Your Cross-Cloud DNS and Traffic Routing Strategy?
Start with one hostname, one failover pair, and a health endpoint you trust. Prove cutover in staging with TTL 60 and external dig checks before you touch production. Add geolocation or weighted migration only when a clear business driver—compliance, cost, or latency data—justifies the complexity.
Cross-Cloud DNS and Traffic Routing is the fastest way to make multi-cloud deployments survivable without exposing multiple URLs to customers. Keep the control plane in code, rehearse failure regularly, and treat DNS as critical infrastructure—not a registrar checkbox you set once and forget.
If you are designing multi-cloud routing for a Laravel app, legal-tech portal, or eCommerce stack in Nepal and want the DNS layer wired correctly from day one, get in touch for architecture and implementation help.

