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?