Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Apr 13 '10 at 1:04

This question came from our site for professional and enthusiast programmers.

    
en.wikipedia.org/wiki/Anycast –  Neil McGuigan Dec 13 '12 at 19:55
add comment

5 Answers 5

up vote 7 down vote accepted

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.

share|improve this answer
    
Damn you! Beat me by less than a min :) +1 –  Billy ONeal Apr 12 '10 at 1:52
    
So DNS server must support this specifically? Are there any hosting companies that provide this? –  HeavyWave Apr 12 '10 at 2:04
1  
They can't generally do this depending on your IP address right? DNS requests typically go through your ISP DNS server first so the DNS servers of Google won't in fact see your IP –  Alexandre Jasmin Apr 12 '10 at 2:12
2  
@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. –  Martin Apr 12 '10 at 2:22
1  
@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. –  Alexandre Jasmin Apr 12 '10 at 2:26
add comment

I believe it's called CDN

share|improve this answer
add comment

Google uses Round Robin DNS. Essentially, Google's DNS server changes the address it gives you based on your location.

share|improve this answer
5  
It'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). –  Tim Green Apr 12 '10 at 1:56
    
@Tim Green -- good point. The idea is the same though. –  Billy ONeal Apr 12 '10 at 2:35
add comment

Depending on the IP that requests the lookup, it will depend on what results they give.

Something like this: http://www.ip2location.com/ip2location-bind-dns.aspx

share|improve this answer
add comment

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.

share|improve this answer
    
+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. –  Chris S Apr 18 '10 at 2:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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