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:
| Type | Means | Like… |
|---|---|---|
| Unicast | One sender → one specific destination | A phone call to one person |
| Broadcast | One sender → everyone on the network | A PA announcement |
| Anycast | One address → the nearest of many | Calling 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):
- The same IP address is advertised from many locations around the world.
- When you send a request to that IP, the network's routing picks the nearest advertisement (by network distance).
- 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
| Benefit | Why it matters |
|---|---|
| Lower latency | You reach the nearest server, not a distant one |
| Resilience | If one location fails, traffic shifts to the next nearest |
| Load distribution | Requests naturally spread across locations |
| DDoS absorption | An 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 | |
|---|---|
| What | One IP advertised from many locations; nearest answers. |
| How | The internet's routing (BGP) picks the closest instance. |
| Why | Lower latency, resilience, load spreading, DDoS defence. |
| Seen in | CDNs, 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.