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?
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.
I believe it's called CDN
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.
Google uses Round Robin DNS. Essentially, Google's DNS server changes the address it gives you based on your location.
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