I'm seeing a weird problem where traffic originating from within a Docker container located on a VM in the Google Cloud in europe-west1 and destined for a UK company based in Amazon's Cloudfront is incorrectly routing all the way out through the US to hit cloudfront in California, causing all kinds of unwanted latency and slowness.

$ ping destination.host.co.uk
PING d3csmaahmfmvav.cloudfront.net ( 56(84) bytes of data.
64 bytes from server-54-192-146-219.sfo4.r.cloudfront.net ( icmp_seq=1 ttl=49 time=161 ms

HOWEVER, traffic originating from the host VM routes correctly to a European Cloudfront location:

$ ping destination.host.co.uk
PING d3csmaafmvavjz.cloudfront.net ( 56(84) bytes of data.
64 bytes from server-54-230-12-31.ams1.r.cloudfront.net ( icmp_req=1 ttl=54 time=10.5 ms

I can't find anything in the network configuration for the Docker containers that would indicate why the containers would be sending traffic to the other side of the planet when the host itself is sending it where we would expect it to.

For the life of me I can't figure out why this is going on, hopefully someone can help point out what I'm missing.


  • What is the output of traceroute? – jftuga May 5 '16 at 19:43
  • It turned out to be a DNS issue (see below). Which, really, makes sense, I suppose. – Ross Messiah May 5 '16 at 19:50

Ahh-hah! I've figured out what was going wrong. The containers are using Google's public DNS servers ( and, and the VM Host is using an internal Google DNS server in their respective resolv.conf files. I (and whomever set up these containers) was making the mistake of trusting google's own DNS servers to know where the hell stuff located in google's own cloud was actually located. How silly of us!

When I changed the the resolv.conf on the container to put that internal DNS server at the top, all of a sudden... It no longer routes traffic to the other side of the damn planet, and therefore ping times go from 160ms down to 10ms. So that's not too shabby.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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