Anycast vs Unicast: What's the Difference?
Key takeaways
- Unicast means one address identifies one server; anycast means the same address is announced from multiple sites.
- BGP routing policy, not client-side distance calculation, decides which anycast site answers.
- Anycast does not guarantee even load distribution or instant failover by itself.
- Running your own anycast service requires an announced prefix and an ASN, not just a single address.
On this page
Unicast means one destination address identifies one specific server. Anycast means the same address is announced from multiple locations, and BGP routing decides which location actually answers a given connection. Both use ordinary IP addressing; the difference is in how many places, and which places, are advertising a route to that address.
Anycast is not a load balancer and not automatic failover. It changes how a network's routers pick a destination for an address; what happens at that destination is a separate design question.
Anycast vs unicast at a glance
| Property | Unicast | Anycast |
|---|---|---|
| Locations announcing the address | One | Multiple, from different sites or providers |
| Which server answers | Always the one server at that address | Whichever site the client's route currently reaches |
| Requires your own announced prefix | Not necessarily | Yes, in general |
| Built-in load distribution | No | Not guaranteed; depends on how routes distribute clients |
| Typical use | Most ordinary servers and services | DNS, CDNs, DDoS-scrubbing services |
How does anycast actually work?
Multiple sites announce routes for the same prefix into BGP. Each network that receives those announcements applies its own routing policy and picks one path, exactly as it would with any other route. See our BGP guide for how that route-selection process works in general; anycast does not change the mechanism, it just means several candidate paths happen to lead to the same advertised address instead of different ones.
The result is that a client's traffic is typically handed to a routing-wise close site, which is often but not always the geographically nearest one. Cloudflare's anycast overview and the operational guidance in RFC 4786 both describe this as a routing-topology outcome, not a distance calculation performed by the client.
Why isn't anycast automatically load balancing?
BGP route selection reflects routing policy and topology, not current server load. If routing sends a disproportionate share of clients toward one site, that site can end up busier than the others with no automatic rebalancing from the anycast mechanism itself.
Operators running an anycast service still need real capacity planning and, commonly, load balancing within each site. Anycast decides which site a connection reaches; it does not decide how that site handles the load it receives.
Why isn't anycast automatic failover?
If a site withdraws its route, for example during an outage, BGP reconverges and traffic shifts to the remaining sites that still announce the prefix. That is a genuine resilience benefit, but reconvergence is not instantaneous. Depending on the network, it can take anywhere from under a second to considerably longer for all affected routers to update.
For long-lived, stateful connections, a route change mid-session can also disrupt the connection, since the client may suddenly be routed to a different site that has no record of that session. This is why anycast is especially common for stateless, short-lived protocols such as DNS, and why services that run anycast over TCP need deliberate engineering, such as consistent routing at each layer, to avoid mid-session disruption.
Where is anycast commonly used?
DNS is the clearest example. The internet's root and top-level domain name servers are announced from many sites worldwide under a small number of anycast addresses, spreading query load and reducing the distance a resolver typically has to reach.
Content delivery networks and DDoS-scrubbing services also rely on anycast so the same published address can be served from whichever of many points of presence is currently reachable and appropriate for a client. AWS Global Accelerator's documentation describes providing static anycast IP addresses that route client traffic to the nearest of several application endpoints as one example of this pattern.
What do you need to run your own anycast service?
You need to control the announced prefix, not just a single address. Routers make forwarding decisions per route, and a route covers a prefix, so a lone address inside someone else's larger announced block cannot be independently steered to a different site. See our CIDR notation guide for what a prefix actually covers.
You also need an ASN to originate the announcement, or a provider or partner willing to originate it on your behalf, at each site you want participating. Our ASN guide and RPKI and ROA guide cover the identifiers and authorizations involved in getting a route accepted by other networks in the first place.
Bringing your own prefix, rather than relying on addresses tied to a single provider, is what makes it possible to announce that same address from more than one provider or region. Our BYOIP introduction explains how that portability works.
FAQ
Related resources
Ready to see where BYOIP is supported?
Continue the series
What Is IP Allowlisting?
IP allowlisting restricts access to approved source addresses. See why NAT, CGNAT and dynamic IPs break naive rules, and what a stable egress address fixes.
6 min read · Updated 18 September 2026
Read articleWhat Is IP Geolocation?
IP geolocation estimates location from an address using external databases. Learn why lookups disagree, what a geofeed corrects, and why BYOIP migrations can show stale locations.
4 min read · Updated 18 September 2026
Read article