google.com different IP in different countries. How?
Solution 1
A DNS name may have multiple A records, clients may then choose any record and use that address.
That's not the entire truth though, Google's DNS servers are also giving you different A records depending on your IP address so that you may use a server close to you.
Solution 2
I believe it's called CDN
Solution 3
I think it is using Anycast IP addressing for the DNS servers. So depending on which part of the world you are, a different DNS server (although with the same IP address) will answer your query. And that server will know which IP address is the best for your location.
Solution 4
Google uses Round Robin DNS. Essentially, Google's DNS server changes the address it gives you based on your location.
Related videos on Youtube
HeavyWave
Updated on September 17, 2022Comments
-
HeavyWave almost 2 years
If you ping google.com from different countries you will get replies from local google servers. How does that work? Can a DNS record have multiple A addresses? Could someone point me to the technology they use to do that?
Update. OK, so Google's DNS server gives out a different IP based on the location. But, as Alexandre Jasmin pointed out, how do they track the location? Surely their DNS won't ever see your IP address. Is the server querying Google's DNS guaranteed to be from the location it represents?
-
Admin over 11 years
-
-
Billy ONeal about 14 yearsDamn you! Beat me by less than a min :) +1
-
Admin about 14 yearsIt's not really Round Robin because it specifically selects your geographically closest servers. You'll never, for example, get US Google servers when making the request from France (assuming all the local ones are not dead).
-
HeavyWave about 14 yearsSo DNS server must support this specifically? Are there any hosting companies that provide this?
-
user3527102 about 14 years@Alexandre: yes, but it usually works anyway since your ISP's resolver is most likely in the same part of the world as you are. It won't work for clients using OpenDNS and similar services though.
-
Alex Jasmin about 14 years@Martin I agree that it usually works anyway. As for OpenDNS I think they use anycast routing so it could work as well depending on how they pass along the request.
-
Billy ONeal about 14 years@Tim Green -- good point. The idea is the same though.
-
Philip about 14 years+1, Correct, Google (and many other large networks) use Anycast to route requests to the closest server. Multiple servers have the same IP, and you get the closest according to the AS routes in BGP.
-
Liga over 4 yearsHow does Round Robin method return the server closest to you? Isn't Round Robin random?