Free tech learning for everyone, from basics to pro

Network ArchitectureNetworking SecurityAdvanced

Global server load balancing and traffic management: DNS-based GSLB, anycast and failover between sites

In short: Global server load balancing directs users to the best site for an application, usually by answering DNS queries with the address of the nearest healthy data centre or region. Health checks remove failed sites, and policies can balance load or keep one site as standby. Anycast and cloud global load balancers achieve similar results at the IP level, often with faster failover.

Beyond one data centre

A local load balancer spreads traffic across servers in one site. When an application runs in two or more data centres or cloud regions, something must decide which site each user goes to, and move users if a site fails. This is global server load balancing (GSLB) or global traffic management.

Global traffic management with DNSUser looks upapp.example.comvia resolverGSLB answershealth + location +policyNearest healthysiteLondon or FrankfurtLocal loadbalancerspreads acrossservers
Figure 1. GSLB picks the site; local load balancers pick the server inside it.

DNS-based GSLB

The GSLB system is authoritative for the application's name. When a resolver asks for app.example.com, it chooses which site's address to return based on:

  • Health: regular checks of each site's service; failed sites are removed.
  • Location: the resolver's (or with EDNS Client Subnet, the user's) approximate location, to pick the nearest site.
  • Load or weighting: spreading users by capacity, or sending a small share to a new site.
  • Policy: active/standby, where a second site is only used when the first fails.

Products include F5 BIG-IP DNS, Citrix ADC, and cloud services such as AWS Route 53 routing policies, Azure Traffic Manager and Cloudflare Load Balancing.

The TTL trade-off

DNS answers are cached for their TTL. A short TTL (30 to 60 seconds) lets users move quickly after a failure, but increases DNS queries. Some resolvers and applications ignore TTLs and keep old answers longer, so DNS failover is never instant. Applications should also retry and reconnect gracefully.

Anycast and global load balancers

  • Anycast: the same IP address is announced with BGP from every site. Routing sends each user to the nearest one, and if a site stops announcing, traffic moves within seconds without any DNS caching issue. Common for DNS services, CDNs and DDoS protection.
  • Cloud global load balancers (Google Cloud global load balancing, Azure Front Door, AWS Global Accelerator) give users one anycast address at the provider's edge and route requests to the best healthy region over the provider's network.

Active/active or active/standby?

  • Active/active: both sites serve users. Better use of capacity and you know both work, but data must be kept in sync between sites, which is the hard part.
  • Active/standby: the second site takes over only on failure. Simpler for data, but the standby must be tested regularly.

Session persistence

Users partway through a session (a shopping basket, a login) may lose their state if moved to another site. Applications should store session state in a shared database or cache, or use tokens, so any site can serve any user.

Real-world example: the region outage

An online booking company ran in two cloud regions with DNS-based GSLB and 60-second TTLs. When one region had a major outage, health checks failed within 30 seconds and the GSLB stopped returning that region. Most users were on the other region within two minutes. Because sessions were stored in a replicated database, they continued their bookings after a page refresh.

Practice

How does DNS-based GSLB send users to a healthy site?
It answers DNS queries with the address of a site that passes health checks, chosen by location, load or policy.
Why is DNS-based failover never instant?
Answers are cached for their TTL, and some resolvers and applications keep old answers longer.
How does anycast achieve site failover?
All sites announce the same IP with BGP; when a site stops announcing it, routing moves users to the next nearest site.

Key takeaways

  • GSLB chooses the site; local load balancers choose the server.
  • DNS-based GSLB uses health, location, load and policy; TTL limits failover speed.
  • Anycast and cloud global load balancers fail over at the IP level.
  • Store session state centrally so any site can serve any user.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: