2

Perhaps I'm not getting it as should, but as far as I got it, CloudFlare should use local(geographically) servers, relative to the user, to deliver the content. But instead, I'm getting all the time US servers(I'm in Europe).

How do I fix this?

3
  • Can you give an example of the IP address and your testing method. Commented Mar 31, 2017 at 8:03
  • @SimonHayter I've used Flagfox plugin for firefox(iplookup.flagfox.net), but because it may be not really accurate I tried online tools such as site24x7.com/find-website-location.html and iplocation.net , all of them are showing my website location at Phoenix, US
    – prizzaloo
    Commented Mar 31, 2017 at 8:17
  • Actually, the flagfox is showing it at San Francisco, but I think this is due the fact flagfox need some more time for updating it, can't say for sure. Perhaps there's a way of forcing CF to work from specific data center, say, Netherlands?
    – prizzaloo
    Commented Mar 31, 2017 at 8:29

2 Answers 2

4

You're likely using a geolocation service to determine the location of the IP address. This may not accurately tell you where the server for that IP is located - Cloudflare owns large IP blocks. These blocks will be registered to them somewhere in the USA and perhaps the servers for these IPs are even located there.

However, if they move a B block in that range to Europe, it means a 1 digit difference in the IP changes the location completely. 104.16.0.0/12 for example is a huge range of IPs. That's over 1.4 mil IPs split into around 64k B blocks (excuse my napkin math).

The ISPs would be aware of an edge router's location but IP block registration databases wouldn't. Do a ping command and use response time and TTL to measure distance. TTL will tell you how many routers your ping has bounced through - even if response time doesn't waver much you'll be able to see that it's gone a greater distance. For further detail, a tracert command (Windows) will also reveal more about location by attempting to resolve and ping each individual router along the way. Done from different origin IPs, you'll also be able to see if your ISP is doing any redirecting for Cloudflare in order to shorten distance travelled.

Edit: Another answer has pointed out you can also use yourdomain.com/cdn-cgi/trace in order to get a debug output with the 'colo=' code indicating the location of the server being used. Example output:

fl=21g22
h=yourdomain.co.uk
ip=your.ip.address
ts=1497653403.144
visit_scheme=https
uag=Mozilla Compatible Agent
colo=LHR // Datacentre location
spdy=h2
http=h2
loc=GB
1
  • Thank you. I actually was able to see the trace route via suggested by you tracert command. It's all fine now. And thanks for explaining this in details
    – prizzaloo
    Commented Mar 31, 2017 at 8:58
4

In addition to Yhorian's explanation, you can find which Cloudflare's datacentre you're being routed to looking at the output of a request to https://yourdomainoncloudflare.com/cdn-cgi/trace, as explained in our knowledge base here.


3
  • Wow, thanks a lot. This indeed very helpful as well.
    – prizzaloo
    Commented Mar 31, 2017 at 10:18
  • Might be more useful to link to cloudflare.com/cdn-cgi/trace as that domain is (rather unsurprisingly) hosted on Cloudflare Commented Mar 31, 2017 at 11:56
  • Unfortunately no, because of the routing policy described here. Depending on the plan your domain is on, requests for that domain may not be routed to the same datacentre as requests for cloudflare.com will be routed to. Commented Mar 31, 2017 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.