Skip to main content

Anycast

Updated: October 29, 2026
By Willya Randika

Anycast announces the same IP address from multiple network locations. Internet routers choose the best path via BGP, so users usually reach the topologically nearest location, not always the geographically nearest. This differs from unicast, where one IP points to one location.

How it works

A provider owns an IP block and announces it from several PoPs. Each PoP runs the same service, such as a DNS resolver or edge proxy. Routers between the user and the provider choose the best BGP route.

If one PoP fails, the route may move to another PoP, depending on configuration and convergence time. Because routing makes the decision, anycast does not guarantee a specific location. Two users in the same city can reach different PoPs if their ISP paths differ.

Benefits

Latency can be lower for DNS and CDNs because requests do not cross continents. DDoS traffic is also spread across locations. If one location or route fails, the service can keep running through another location. The IP address does not change when capacity is added.

Anycast underpins many public DNS services and CDNs. For ordinary applications, a CDN or load balancer usually provides it rather than direct server configuration.

Limits and risks

State is not automatically synchronized. If a long-lived TCP connection moves PoPs, the session can break. Apps that keep state in local memory need replication or sticky routing.

Routing can change without warning. A route leak can also happen when BGP is misconfigured. The BGP “nearest” is not necessarily the lowest latency.

Anycast is harder to debug. traceroute from one location sees only one path. Use looking glasses and measurements from several regions. dig +short example.com shows the DNS answer, not the anycast location. To measure the path, use mtr or traceroute.

Anycast is often combined with DNS, a CDN, a load balancer, and DDoS mitigation.

FAQ

Does anycast speed up every application?

No. The biggest gains are for stateless or replicable services such as DNS, CDN, and edge proxies. Stateful apps need extra design.

Is anycast the same as load balancing?

No. A load balancer distributes traffic at one or more locations. Anycast chooses a location based on internet routing. They can be used together.

Why does my anycast IP appear in another city?

BGP routing does not always follow geographic distance. Your ISP may choose a farther PoP that is better according to its network policy.

Disclaimer: Hosting Wiki articles are prepared for educational and reference purposes. Hosting technology keeps evolving, so some technical details may change over time.