Hello everyone! I have a small question and was wondering if someone could help me with that.
Question is - why companies like Google, Amazon are having partial anycasting in CDN setups? E.g if we pick a random hostname from url of Picasa picture - lh3.googleusercontent.com - this one is further a cname string and at the end you will find different A records when checked from different locations. E.g when checked from my local system (in India): ;; QUESTION SECTION: ;lh3.googleusercontent.com. IN A ;; ANSWER SECTION: lh3.googleusercontent.com. 86276 IN CNAME googlehosted.l.googleusercontent.com. googlehosted.l.googleusercontent.com. 176 IN A 209.85.175.132 Next, lookup from a server in Europe: ;; QUESTION SECTION: ;lh3.googleusercontent.com. IN A ;; ANSWER SECTION: lh3.googleusercontent.com. 86400 IN CNAME googlehosted.l.googleusercontent.com. googlehosted.l.googleusercontent.com. 300 IN A 209.85.148.132 thus different IPs in both cases. I understand that Google is doing anycasting on core DNS servers, and thus we always hit nearest DNS server and all DNS servers are sort of independent and carry different A records for CDN strings which point to local cache server IP addresses. And here's confirmation: anurag@laptop:~$ dig googleusercontent.com. ns +short ns2.google.com. ns3.google.com. ns4.google.com. ns1.google.com. Picking ns1.google.com. and asking IP for googlehosted.l.googleusercontent.com. from different locations: anurag@laptop:~$ dig @ns1.google.com googlehosted.l.googleusercontent.com. a +short 209.85.175.132 anurag@server7:~$ dig @ns1.google.com googlehosted.l.googleusercontent.com. a +short 209.85.148.132 As expected - same server (which appears same but is different) giving different values - thus I am actually hitting different servers in both cases. Now my question here is - why this setup and not simply using having a A record for googlehosted.l.googleusercontent.com. which comes from any anycasted IP address space? Why not anycasting at CDN itself rather then only at DNS layer? Can someone explain? Thanks! -- Anurag Bhatia anuragbhatia.com or simply - http://[2001:470:26:78f::5] if you are on IPv6 connected network! Twitter: @anurag_bhatia <https://twitter.com/#!/anurag_bhatia> Linkedin: http://linkedin.anuragbhatia.com