Skip to content
AnswerWell geo Documentation

Research · 9 min read · Answerwell

Anycast Data Center Routing, Colo Identification, and Traffic Steering

Why anycast may not use the nearest colo, how to read cf-ray and cdn-cgi/trace, and when Magic WAN region-scoped routes apply.

This page summarises Cloudflare documentation on why visitor traffic is not always handled at the geographically closest data center, how to see which colo actually serves a request, and what site owners can change versus what depends on ISP routing or enterprise Magic WAN / Cloudflare WAN configuration.

Anycast routing: why the closest data center does not always serve traffic

Section titled “Anycast routing: why the closest data center does not always serve traffic”

On Cloudflare’s anycast network, a request may reach a data center that is not the closest by map distance. Cloudflare adds capacity and tunes automated traffic engineering for congestion and other events; the goal is nearby service when possible, but reliability takes priority.

Due to the way routing on Cloudflare’s anycast network works, requests may be sent to data centers that are not the closest geographically. Cloudflare continuously adds capacity to its global network and improves its automated traffic engineering systems to manage congestion and other network events. Cloudflare aims to serve traffic from the closest location for the best performance, but reliability takes priority.

When performance and reliability conflict, Cloudflare’s systems prioritize a stable connection over a local one.

— Cloudflare, Cloudflare traffic not being sent to the geographically closest data center

For HTTP sites behind the proxy, Cloudflare does not pick a data center per visitor. The same IP addresses are announced from many locations; the visitor’s ISP chooses where packets land based on peering and routing policy—which often favors a city where the ISP has a direct Cloudflare connection rather than a nearer city without one.

Cloudflare uses anycast to announce the same IP addresses from many data centers at the same time. Cloudflare does not pick a data center for each visitor. The visitor’s Internet service provider (ISP) decides which Cloudflare data center receives the request, based on its own routing and peering policies.

— Cloudflare, Cloudflare traffic not being sent to the geographically closest data center

Cloudflare can influence paths at the network level, but data center selection cannot be configured per zone, per account, or by support request for standard CDN traffic.

Why performance still depends on colo choice

Section titled “Why performance still depends on colo choice”

When a request reaches Cloudflare, uncached content is fetched from your origin. If users are served from a distant colo, that path to the origin adds latency. Troubleshooting a slow website treats understanding network routing as a core step for performance work.

Colo identification: how to check which data center serves my traffic

Section titled “Colo identification: how to check which data center serves my traffic”

To see which Cloudflare data center processed a request, use /cdn-cgi/trace or the cf-ray response header.

Visit https://<YOUR_DOMAIN>/cdn-cgi/trace in a browser and note the colo field in the output. You can also check the cf-ray response header. The three-letter code at the end of the value identifies the data center that processed the request. Both use the IATA code of a nearby major airport.

— Cloudflare, Cloudflare traffic not being sent to the geographically closest data center

From the command line:

curl https://www.example.com/cdn-cgi/trace

The trace output’s colo field (for example colo=SJC) matches the airport-style code at the end of cf-ray, as described in Troubleshooting a slow website.

Data center pinning: can I choose or pin the colo for visitors?

Section titled “Data center pinning: can I choose or pin the colo for visitors?”

For proxied zones on the public anycast CDN, no. There is no dashboard setting to pin individual visitors to a specific colo.

Enterprise customers who run Cloudflare WAN / Magic WAN and need traffic that enters Cloudflare in one region to egress through a particular tunnel can use region-scoped static routes—a form of traffic steering unrelated to per-visitor CDN pinning.

If you have multiple connectivity paths to a network segment and want to apply different route prioritization based on where traffic arrives at the Cloudflare network, you can scope routes to specific Cloudflare data center regions.

— Cloudflare, Traffic steering

Region scoping applies only to statically configured routes, not BGP peering, and every prefix must have route coverage in all regions you use; otherwise traffic that lands in an uncovered region is dropped.

Consecutive requests, caching, and changing colos

Section titled “Consecutive requests, caching, and changing colos”

Seeing different colos on back-to-back tests is expected. Selection depends on conditions at request time, so the same visitor may hit different data centers, and tests from other networks or times will differ.

This variability is normal for anycast routing and does not indicate a problem with your zone or a misconfiguration.

— Cloudflare, Cloudflare traffic not being sent to the geographically closest data center

Each colo maintains its own cache, so a HIT in one location can become a MISS when the next request is served elsewhere. Tiered Cache reduces how often those misses reach your origin (see Cloudflare traffic not being sent to the geographically closest data center).

Colos also change over time because of maintenance, ISP routing shifts, congestion, and Cloudflare traffic engineering—not because of a misconfigured zone.

Another domain on Cloudflare shows a nearer colo than mine

Section titled “Another domain on Cloudflare shows a nearer colo than mine”

The set of data centers that can serve a given customer domain varies. A neighbor domain appearing closer does not prove your traffic is misrouted or your zone is wrong.

Traceroute vs cf-ray: entry point vs processing colo

Section titled “Traceroute vs cf-ray: entry point vs processing colo”

A traceroute that ends at a nearby Cloudflare hop shows where traffic entered the network; the code at the end of cf-ray is the data center that processed the request. Those locations need not match.

With Argo Smart Routing or Tiered Cache, the cf-ray your origin sees can differ from what the visitor receives, because the header on the origin connection reflects the colo that reached the origin, not necessarily the colo that received the visitor’s request.

Symptom Typical explanation
Requests route to a distant data center Traffic engineering for reliability, or ISP routing
cf-ray differs from traceroute last hop Entry vs processing location; optional cross-network features
Routing changes between requests Normal anycast adaptation
Consistent distant region ISP peering or capacity management
High latency despite “nearby” colo on trace Congestion on the path

Source: Troubleshooting a slow website and Cloudflare traffic not being sent to the geographically closest data center.

Section titled “IPv4, IPv6, WARP, and DNS: related routing behavior”

IPv4 and IPv6 from the same visitor can land in different colos because routing paths differ; that is expected anycast behavior.

Visitor geolocation in rules does not follow the serving colo. Cloudflare derives location from the visitor IP; CF-IPCountry and fields such as ip.src.country reflect the visitor even when a distant colo serves the request.

For DNS Firewall, DNS queries are handled at the Cloudflare data center closest to the DNS resolver (resolver location), not necessarily closest to the web visitor—see DNS Firewall.

Cloudflare WARP clients may not connect to the physically nearest server: maintenance, ISP path choice, and the fact that not every Cloudflare location is WARP-enabled all play a role (WARP client FAQ, Devices FAQ).

RUM beacons for Web Analytics are processed at a nearby colo as determined by anycast routing; processing can occur in a different country from where the page was viewed, and client IPs are discarded at that colo per RUM beacon for Web Analytics.

Magic WAN and BGP: when enterprise traffic uses distant paths

Section titled “Magic WAN and BGP: when enterprise traffic uses distant paths”

Symptoms such as regional users seeing high latency, traffic not using the closest tunnel or CNI, or regions landing in unexpected data centers are covered under Troubleshoot routing and BGP (also mirrored for Cloudflare One and Magic Transit).

  1. Check tunnel health — Degraded tunnels get 500,000 added to route priority; down tunnels get 1,000,000, shifting traffic to healthier paths that may be in other regions (Troubleshoot routing and BGP).
  2. Review route priorities — Lower numbers mean higher preference; default BGP priority is 100, and static routes at 100 beat BGP routes at 100.
  3. Validate region-scoped routes — Ensure every region has matching coverage so traffic is not dropped (Traffic steering).
  4. Use Network Analytics — Confirm where traffic lands and which paths it uses (Troubleshoot connectivity).

Tunnel flapping, IPsec errors, and dashboard health checks are tied to Troubleshoot tunnel health and Connectivity troubleshooting.

ISP-specific distant colos: what site owners can do

Section titled “ISP-specific distant colos: what site owners can do”

You cannot change how an ISP reaches Cloudflare from zone settings. If visitors on one ISP consistently hit a distant colo with poor performance, Cloudflare Support can review paths when you supply:

  • ISP name and ASN (if known)
  • Output of https://<YOUR_DOMAIN>/cdn-cgi/trace
  • Traceroute and MTR to your domain
  • cf-ray values and timestamps for affected requests

A routing change is not guaranteed, because it depends on the ISP’s routing policies. Affected visitors can also report the issue to their ISP.

— Cloudflare, Cloudflare traffic not being sent to the geographically closest data center

If requests time out without a cf-ray header, see the ISP-blocking guidance referenced from the same article. For sustained slowness or failures—not mere colo variance—gather details per Troubleshooting a slow website and Gathering information for troubleshooting sites (linked from the geographic routing doc).

Common mistakes when interpreting colo and geolocation

Section titled “Common mistakes when interpreting colo and geolocation”
  • Treating colo as visitor country — IP geolocation is an estimate and is separate from serving colo; do not rely on IP geolocation alone for strict compliance (IP geolocation).
  • Expecting SEO harm from server/colo location — Cloudflare notes that, per Google, server location is not important for SEO, and using Cloudflare nameservers or caching does not by itself harm SEO (Improve SEO).
  • Assuming you can pin CDN colos — Pinning is not a zone-level feature; WAN steering is a different product surface.
  • Ignoring tunnel health on WAN — A “distant” egress path may be intentional failover after health demotion.
  • Comparing unrelated domains’ colos — Eligible data centers differ per customer.
  1. From an affected network, open https://<YOUR_DOMAIN>/cdn-cgi/trace or run curl as in Troubleshooting a slow website and record colo, ip, and loc.
  2. Compare the cf-ray header on the same requests with the trace colo code.
  3. Run traceroute or MTR to your domain and contrast the last Cloudflare hop with the cf-ray processing code (Cloudflare traffic not being sent to the geographically closest data center).
  4. If you use Cloudflare WAN, review tunnel health in the dashboard and route priorities per Troubleshoot routing and BGP.
  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected or explained.