---
title: "What is anycast and how one IP answers from many places | StreetHosting"
description: "Learn unicast, anycast and multicast, how BGP announces the same IP from many locations, where anycast is used and why it does not suit a game server."
url: "https://streethosting.com.br/en/guides/infrastructure/what-is-anycast"
type: "page"
language: "en-US"
---

Infrastructure · 7 min · Intermediate

Published on Nov 13, 2026 · Updated on Nov 13, 2026

# Anycast: one IP address, many servers and BGP picking the closest one

With anycast, the same IP is announced from many locations at once and each visitor lands on the closest one as routing sees it. That is how the DNS root, public resolvers, CDNs and a lot of DDoS mitigation work.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[DDoS protection](https://streethosting.com.br/en/guides/topics/ddos-protection) [Network, DNS and domains](https://streethosting.com.br/en/guides/topics/networking)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=What%20is%20anycast%20and%20how%20one%20IP%20answers%20from%20many%20places&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast "Share on LinkedIn") [](https://wa.me/?text=What%20is%20anycast%20and%20how%20one%20IP%20answers%20from%20many%20places%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Finfrastructure%2Fwhat-is-anycast "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast.md)

In this guide 6 sections

* [Unicast, anycast and multicast](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#tres-formas)
* [How BGP does it](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#como-funciona)
* [Where anycast is used](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-se-usa)
* [How to see anycast in practice](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#ver-na-pratica)
* [Why it does not suit a game server](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#jogos)
* [On StreetHosting](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-rodar)

Quick answer

**Anycast** is when the same IP address is announced by several servers in different locations at the same time, using BGP. Each packet goes to the closest destination as routing sees it. It is the basis of the DNS root, of public resolvers such as 1.1.1.1 and 8.8.8.8, of CDNs and of a lot of DDoS mitigation. It does not suit a game server with state in a single place, because the next packet of a connection can be delivered at another point.

## Unicast, anycast and multicast[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#tres-formas)

There are three ways to address a packet, and the difference is how many machines answer for one address and how many receive the message.

| Mode      | Who receives it                                                        | Example use                                                   |
| --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------- |
| Unicast   | A single machine, the owner of the address                             | A website, a VPS, an SSH connection                           |
| Anycast   | One machine among several announcing the same address, the closest one | DNS root, 1.1.1.1, CDN                                        |
| Multicast | Every machine that joined a group                                      | IPTV inside a carrier, service discovery on the local network |
| Broadcast | Every machine on the local network (IPv4 only)                         | DHCP request, ARP                                             |

Unicast is what you use almost all the time. Multicast uses the `224.0.0.0/4` range on IPv4 and works well inside a controlled network, but it barely crosses the public internet. Anycast, on the other hand, is not a special kind of address. It is an ordinary unicast address that, by decision of whoever runs the network, shows up in more than one place.

## How BGP does it[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#como-funciona)

The internet is a set of independent networks, called autonomous systems, that exchange routes over BGP. Each network announces to its neighbors which IP blocks it can reach. With anycast, several points of presence announce the same block, for example an IPv4 `/24`, from different datacenters: São Paulo, Miami, Frankfurt, Tokyo.

Every router that receives those routes keeps the best one by its own criteria. The main one is path length, measured in hops between autonomous systems, plus each carrier's preferences. The result is that a visitor in Recife is usually delivered to the Brazilian point, and a visitor in Berlin to the European one, without anyone having to ask them anything. If a point goes down and stops announcing the route, routing converges on the next closest one and traffic moves within seconds or a few minutes. To understand better how these routes are exchanged, read the guide on [BGP and internet routing](https://streethosting.com.br/en/guides/infrastructure/what-is-bgp-internet-routing).

Closest here means closest as BGP sees it, not closest on the map. Two providers that only connect on another continent can make a Brazilian user be served from a point abroad, even with a São Paulo point up. Whoever runs anycast seriously spends their time adjusting announcements to fix those cases.

## Where anycast is used[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-se-usa)

* **DNS root:** there are 13 root server addresses, from A to M, but each one is served by many instances spread across the world, adding up to well over a thousand machines. Anycast is what allows that without changing the address every resolver already knows.
* **Public resolvers:** 1.1.1.1, 8.8.8.8 and 9.9.9.9 are easy to remember addresses that answer at the point closest to you.
* **CDN:** the same edge IP serves the visitor at the closest point, which delivers cached content and only goes to the origin when it has to. The guide on [CDNs and game servers](https://streethosting.com.br/en/guides/infrastructure/what-is-a-cdn-game-server) shows where this helps and where it does not.
* **Distributed DDoS mitigation:** when an attack targets an IP announced in many points, each point receives only the share of the attack that starts near it. The total absorption capacity is the sum of all of them, and clean traffic then continues to the origin server. The attack layers this model covers best are in the guide on [DDoS at layers 3, 4 and 7](https://streethosting.com.br/en/guides/infrastructure/layer-3-vs-layer-4-vs-layer-7-ddos).
* **Stateless services in general:** NTP, update servers, edge APIs and anything where a request does not depend on remembering the previous one.

The pattern repeats: anycast works best when each question is independent. A DNS query is a UDP packet that goes and comes back, and it does not matter which instance answered.

## How to see anycast in practice[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#ver-na-pratica)

You can notice anycast from home. One way is to query the identifier of the point that answered. Cloudflare's resolvers return the airport code of the city where they are, and several root servers return an instance identifier when you ask for the NSID option.

`# Linux or macOS: which Cloudflare point answered dig +short CH TXT id.server @1.1.1.1 # which root server instance handled the query dig +nsid . NS @k.root-servers.net # Windows, to see the path to 1.1.1.1 tracert -d 1.1.1.1 # Linux traceroute -n 1.1.1.1`

What gives anycast away is the result changing with your location: the same command, from a VPS in São Paulo and from a machine in Europe, shows different points and very low latencies in both cases. If ping to 1.1.1.1 gives 2 or 3 ms, you are obviously not talking to a server on another continent. Reading the path follows the logic of the guide on [using traceroute to find routing problems](https://streethosting.com.br/en/guides/infrastructure/how-to-use-traceroute).

The `id.server` and NSID answers are an optional feature that each operator decides to turn on and format. If a command returns nothing, it is not your mistake: that server simply does not publish that data.

## Why it does not suit a game server[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#jogos)

A game server keeps state: the map, the players' positions, the match in progress. Every player in a match has to talk to the same machine. Anycast delivers each packet to the closest point at the moment it leaves, and that point can change during the connection.

* **The route changes mid session:** a link failure or a carrier adjustment can make the next packet land on another instance, which does not know the connection and answers with a reset or ignores it.
* **Different players would land on different machines:** two friends in the same match, in distant cities, would be served by different instances, each with a different world.
* **Syncing state between points costs latency:** keeping every instance identical requires exchanging data between them, and that cancels the gain of being close to the player.

In practice, what people do is use anycast in front, to absorb attacks and receive traffic, and keep the game server on a unicast address in a single place, chosen to be close to the players. That balance is covered in the guide on [latency and ping on servers](https://streethosting.com.br/en/guides/infrastructure/what-is-latency-and-ping). The protocol matters too: a long TCP connection drops at once if a packet ends up at another instance, while a short UDP query, like a DNS one, does not even notice the switch. The differences between the two are in the guide on [TCP vs UDP on servers](https://streethosting.com.br/en/guides/infrastructure/tcp-vs-udp).

## On StreetHosting[](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-rodar)

The [StreetHosting VPS](https://streethosting.com.br/en/vps) plans are in São Paulo and each one has a dedicated IPv4, that is, an ordinary unicast address, ideal for a server with state such as a game server, a database or an API. All of them include AntiDDoS. To learn how the protection is built, see the [infrastructure](https://streethosting.com.br/en/infraestructure) page.

If your project really needs anycast, for example your own DNS service on several continents, the path involves your own IP block and autonomous system number, plus a provider that accepts announcing routes over BGP at each location. That is not part of what a regular VPS offers.

In this guide

* [Unicast, anycast and multicast](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#tres-formas)
* [How BGP does it](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#como-funciona)
* [Where anycast is used](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-se-usa)
* [How to see anycast in practice](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#ver-na-pratica)
* [Why it does not suit a game server](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#jogos)
* [On StreetHosting](https://streethosting.com.br/en/guides/infrastructure/what-is-anycast#onde-rodar)

## Frequently asked questions

What is the difference between anycast and unicast?

With unicast, an IP address belongs to a single machine in a single place. With anycast, the same address is announced by several machines in different places, and the network delivers each packet to the closest one as routing sees it.

Does anycast lower ping?

In most cases yes, because the visitor lands on a point of presence close by. But close in BGP terms is not always close on the map: depending on agreements between carriers, a user in Brazil can be served from a point abroad.

Are 8.8.8.8 and 1.1.1.1 anycast?

Yes. Both are public DNS resolvers that announce the same address from many locations around the world. That is why response times are low in almost any country.

Can I use anycast for my game server?

It makes no sense for a stateful server in a single place. Players must always reach the same machine, and with anycast a route change can send the next packet to another point. Protection can be anycast in front, but the server itself stays unicast.

Does anycast protect against DDoS?

It helps a lot, because the attack is split across the many points instead of arriving whole at one. Each point absorbs the share of traffic that starts closest to it. Even so, it does not replace filtering: malicious traffic still has to be dropped somewhere.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[Explore the infrastructure Datacenter in São Paulo, gamer network and options for high-demand projects.](https://streethosting.com.br/en/infraestructure)

## Related guides

[Infrastructure Advanced What is BGP: how the internet picks the path between you and a server The internet is a network of networks, and BGP is the protocol those networks use to agree on where traffic goes. Knowing the basics explains why the same server has a different ping on each ISP and how to investigate it. 10 min Read guide](https://streethosting.com.br/en/guides/infrastructure/what-is-bgp-internet-routing) [Infrastructure Intermediate What is a CDN and when does a game server need one A CDN speeds up websites, panels and downloads by delivering content from a point close to the visitor. But it works on the web, not on the game port. Here is where it helps and where it does not. 3 min Read guide](https://streethosting.com.br/en/guides/infrastructure/what-is-a-cdn-game-server) [Infrastructure Intermediate Layer 3 vs layer 4 vs layer 7 DDoS: what's the difference? A layer 3 DDoS fills the pipe, a layer 4 DDoS fills up connection tables, and a layer 7 DDoS makes the application work until it falls over. See what each one exhausts and at which point in the infrastructure each defense works. 9 min Read guide](https://streethosting.com.br/en/guides/infrastructure/layer-3-vs-layer-4-vs-layer-7-ddos)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
