Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have an /etc/hosts block on 2o7.net and it seems that Apple's metrics.apple.com is a DNS alias for 2o7. When navigating apple.com with Chrome or Safari, I get the following:

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://metrics.apple.com/b/ss/appleglobal,appleusmac,appleusmacbookpro/1/H.…er%3BQuickTime%20Plug-in%207.7.1%3BSharePoint%20Browser%20Plug-in%3B&AQE=1

Whenever I get this message Javascript seems to break and pretty much even link on the site is ignored. I'm not sure if this is a browser bug.

I don't want to unblock 2o7.net but would obviously like the site to work. Any ideas?

share|improve this question

1 Answer 1

dig metrics.apple.com gives

;; ANSWER SECTION:
metrics.apple.com.  4107    IN  CNAME   appleglobal.112.2o7.net.
appleglobal.112.2o7.net. 249    IN  A   66.235.133.14
appleglobal.112.2o7.net. 249    IN  A   66.235.138.2
...

so you could try to dynamically update your hosts file every hour or so:

grep -v metrics.apple.com /etc/hosts > /tmp/raw-hosts
echo $(dig metrics.apple.com | 
       grep ^appleglobal | 
       head -1 | cut -c 35-) metrics.apple.com appleglobal.112.2o7.net >> /tmp/raw-hosts
mv /tmp/raw-hosts /etc/hosts
share|improve this answer
    
These IPs invariably change often, the nature of a CDN. –  Jason Salaz Apr 8 '13 at 16:42
    
Ah, good point. –  patrix Apr 8 '13 at 17:42

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.