All posts
Networking3 min readWatchFor Team

Anycast Explained: one IP, served from everywhere

Anycast is the clever routing trick behind fast CDNs and resilient DNS: one IP address answered by the nearest of many servers. Here's how it works and why it matters.

Anycast Explained: one IP, served from everywhere

How can a single IP address be served from dozens of cities at once, always routing you to the nearest one? It sounds impossible, but it's the everyday magic behind CDNs, big DNS resolvers (like 1.1.1.1), and DDoS-resilient infrastructure. The trick is called anycast.

The "casts" — a quick map

Networking has a few ways to address traffic:

TypeMeansLike…
UnicastOne sender → one specific destinationA phone call to one person
BroadcastOne sender → everyone on the networkA PA announcement
AnycastOne address → the nearest of manyCalling a hotline that routes to your local branch

Most internet traffic is unicast (one specific server). Anycast is the interesting one: the same IP address is announced from many locations, and the network delivers your request to whichever is closest.

How anycast works

The magic happens in the internet's routing layer (BGP):

  1. The same IP address is advertised from many locations around the world.
  2. When you send a request to that IP, the network's routing picks the nearest advertisement (by network distance).
  3. Your request lands at the closest server — automatically, with no special setup on your end.

You just connect to one IP; the internet quietly routes you to the best instance.

Why it's so useful

BenefitWhy it matters
Lower latencyYou reach the nearest server, not a distant one
ResilienceIf one location fails, traffic shifts to the next nearest
Load distributionRequests naturally spread across locations
DDoS absorptionAn attack is split across many locations, not one target

That last point is big: anycast spreads a flood of attack traffic across the whole network instead of concentrating it on a single server — a key reason large DNS and CDN providers use it.

Where you've seen it

  • CDNs use anycast so you hit the nearest edge automatically.
  • Public DNS resolvers (the famous 8.8.8.8, 1.1.1.1) are anycast — the same IP answers from hundreds of locations worldwide.
  • DDoS protection services rely on it to absorb and spread attacks.

The one-line idea: anycast = one address, many servers, nearest wins. You connect once; the routing layer hands you off to the closest, healthiest instance.

A monitoring note

Because an anycast IP is answered by different physical servers depending on where you are, monitoring it from multiple locations is the only way to see the whole picture — one region might hit a healthy node while another hits a struggling one, all behind the same address.

The bottom line

In one line
WhatOne IP advertised from many locations; nearest answers.
HowThe internet's routing (BGP) picks the closest instance.
WhyLower latency, resilience, load spreading, DDoS defence.
Seen inCDNs, public DNS resolvers, DDoS protection.

Anycast is one of those quietly brilliant internet tricks: the same address, served from everywhere, always picking the nearest. It's why a CDN feels local and why big DNS resolvers shrug off attacks.

Related: What is a CDN?, What is BGP?, how DNS works.

Share this article