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 a MacBook Pro Early 2011 running Lion 10.7.4 (11E53)

I have installed an SSD instead of the optical drive, and encrypted both hard drives with FileVault2.

For some time now I noticed I can't access the apple.com servers, not even in Safari/Chrome/Firefox.

If I try to ping www.apple.com it doesn't find the host, but when I do a dig apple.com I get the informations.

It's very very strange, any ideas?

In the meantime I booted to recovery with cmd-R and reinstalled Lion but to no avail. Strangely though, in recovery there are no problems accessing the apple servers, because the Lion image was downloaded on the fly..

Later edit, results from dig apple.com any and ping www.apple.com

➜  ~  dig apple.com any              
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.7.3-P3 <<>> apple.com any
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53874
;; flags: qr rd ra; QUERY: 1, ANSWER: 24, AUTHORITY: 6, ADDITIONAL: 6

;; QUESTION SECTION:
;apple.com.         IN  ANY

;; ANSWER SECTION:
apple.com.      3542    IN  TXT "v=spf1 ip4:17.0.0.0/8 ~all"
apple.com.      86342   IN  SOA gridmaster-ib.apple.com. hostmaster.apple.com. 2010076647 1800 900 2016000 86500
apple.com.      86342   IN  NAPTR   50 50 "se" "SIPS+D2T" "" _sips._tcp.apple.com.
apple.com.      86342   IN  NAPTR   90 50 "se" "SIP+D2T" "" _sip._tcp.apple.com.
apple.com.      86342   IN  NAPTR   100 50 "se" "SIP+D2U" "" _sip._udp.apple.com.
apple.com.      3542    IN  MX  10 mail-in11.apple.com.
apple.com.      3542    IN  MX  10 mail-in12.apple.com.
apple.com.      3542    IN  MX  10 mail-in13.apple.com.
apple.com.      3542    IN  MX  10 mail-in14.apple.com.
apple.com.      3542    IN  MX  10 mail-in15.apple.com.
apple.com.      3542    IN  MX  20 mail-in21.apple.com.
apple.com.      3542    IN  MX  20 mail-in22.apple.com.
apple.com.      3542    IN  MX  20 mail-in23.apple.com.
apple.com.      3542    IN  MX  20 mail-in24.apple.com.
apple.com.      3542    IN  MX  20 mail-in25.apple.com.
apple.com.      3542    IN  MX  100 mail-in3.apple.com.
apple.com.      1731    IN  A   17.149.160.49
apple.com.      1731    IN  A   17.172.224.47
apple.com.      86342   IN  NS  nserver.asia.apple.com.
apple.com.      86342   IN  NS  nserver.euro.apple.com.
apple.com.      86342   IN  NS  nserver.apple.com.
apple.com.      86342   IN  NS  nserver3.apple.com.
apple.com.      86342   IN  NS  nserver2.apple.com.
apple.com.      86342   IN  NS  nserver4.apple.com.

;; AUTHORITY SECTION:
apple.com.      86342   IN  NS  nserver3.apple.com.
apple.com.      86342   IN  NS  nserver.apple.com.
apple.com.      86342   IN  NS  nserver2.apple.com.
apple.com.      86342   IN  NS  nserver.asia.apple.com.
apple.com.      86342   IN  NS  nserver.euro.apple.com.
apple.com.      86342   IN  NS  nserver4.apple.com.

;; ADDITIONAL SECTION:
nserver.asia.apple.com. 85475   IN  A   17.82.254.3
nserver.euro.apple.com. 85475   IN  A   17.72.133.64
nserver.apple.com.  85475   IN  A   17.254.0.50
nserver2.apple.com. 85475   IN  A   17.254.0.59
nserver3.apple.com. 85475   IN  A   17.112.144.50
nserver4.apple.com. 85475   IN  A   17.112.144.59

;; Query time: 5 msec
;; SERVER: 213.154.124.221#53(213.154.124.221)
;; WHEN: Tue Jun 19 08:08:40 2012
;; MSG SIZE  rcvd: 918

And the ping:

➜  ~  ping -c 1 www.apple.com
ping: cannot resolve www.apple.com: Unknown host

➜  ~  ping -c 1 apple.com
ping: cannot resolve apple.com: Unknown host
share|improve this question
    
apple.com and www.apple.com are different things. What does dig report for www.apple.com? –  molbdnilo Jun 19 '12 at 4:16
    
dig www.apple.com returns: ;; ANSWER SECTION: www.apple.com. 1365 IN CNAME www.isg-apple.com.akadns.net. www.isg-apple.com.akadns.net. 14 IN CNAME www.apple.com.edgekey.net. www.apple.com.edgekey.net. 12160 IN CNAME e3191.c.akamaiedge.net. e3191.c.akamaiedge.net. 4 IN A 23.11.77.15 –  tXK Jun 19 '12 at 5:14
    
This occurs even while booted from the recovery partition. Might be related to the recent world IPv6 launch? Just a stab in the dark. Other than that, you should check from an alternate site as your router or ISP is likely at fault –  username Jun 21 '12 at 20:53
2  
Did you check your hosts file? Launch Terminal, type in sudo nano /etc/hosts/ and check if there are any irregular entries concerning apple.com. Could it be that an outgoing firewall - like Little Snitch - is blocking the connection by an accidental added rule? –  Bart Arondson Jun 21 '12 at 20:59
2  
@BartArondson +1, but that should be /etc/hosts not /etc/hosts/. –  bahamat Jun 23 '12 at 0:11
show 4 more comments

7 Answers

up vote 2 down vote accepted
+50

Given that you've already checked your DNS and /etc/hosts and flushed the DNS cache using dscacheutil -flushcache it is quite possible you have malware on your machine. You have re-installed Lion which should take care of any file corruption issues, but may not remove malware if you recovered your user files from a backup. Double-check your network settings to ensure you are not using any proxies, but other than that, malware seems the most likely culprit.

EDIT: It seems dscacheutil -flushcache no longer works to flush the DNS cache. Before we flush the cache the new way, let's take a look at it. Run:

sudo killall -INFO mDNSResponder

and then look at the system.log file. You can view it in the Console app under Files or you can view it in the terminal with less /var/log/system.log. Either way, mDNSResponder dumps a lot of information into the system.log as a result of that command, which should help pinpoint the problem. Search for "apple.com" in the results and see what you come up with. Then try

sudo killall -HUP mDNSResponder

to actually flush the cache and try ping www.apple.com again.


You have tried dig www.apple.com which correctly resolved to e3191.c.akamaiedge.net which is a CDN domain that will have different IP addresses depending on where you connect to the internet. Try nslookup www.apple.com and you should get the same thing, e.g.

user$ nslookup www.apple.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
www.apple.com   canonical name = www.isg-apple.com.akadns.net.
www.isg-apple.com.akadns.net    canonical name = www.apple.com.edgekey.net.
www.apple.com.edgekey.net   canonical name = e3191.c.akamaiedge.net.
Name:   e3191.c.akamaiedge.net
Address: 23.11.77.15

So you should be able to ping www.apple.com, e3191.c.akamaiedge.net, and 23.11.77.15 (or whatever IP address you get from dig). (While it is true that many servers do not respond to ping requests, this server does respond and your problem isn't that you cannot get a response anyway, it's that you cannot resolve the domain name.) If you can ping some but not all, then you probably have a malware problem.

There were a bunch of trojans circulating as video codecs that messed with DNS. I suggest getting a reputable malware scanner and checking your system.

share|improve this answer
add comment

Which DNS servers are you using?

$ networksetup -getdnsservers Wi-Fi

or

$ networksetup -getdnsservers Ethernet

For example is the first resolver a Mac OS X Lion server running DNS service?

In that case, have you tried disabling "Configure IPv6" on the machine where the DNS service is installed? See the Network pane > [ Advanced ], or at least to change it from [Automatically] to [Local-link only].

Can you please include the output of a $ dig www.apple.com +trace command, preferably also when ran on the first DNS resolver?

share|improve this answer
    
I thought of that too, and disabled IPv6 on the router and also on the Mac.. no results –  tXK Jun 26 '12 at 14:25
    
But which networks (Ethernet, WiFi, etc.) are connected to your troubling machine, and which DNS-servers are configured for each of them? And/or update your question with the output of $ nslookup www.apple.com. –  Pro Backup Jun 26 '12 at 15:37
add comment

Mea culpa: I misread your question and thought you wrote that you had already tried connecting to www.apple.com while booted to the Recovery Partition (you can launch Safari from the Recovery Partition). I reread your question and it sounds like you used the Recovery partition simply to reinstall your OS.

If you have not tried this then you definitely should! If you can reach www.apple.com from the Recovery Partition then you have a System issue - if you can not then you have an ISP, or a router issue.

share|improve this answer
    
I can access apple servers from Recovery. I specifically mentioned it in the question's post –  tXK Jun 26 '12 at 14:26
    
oops, sorry! then i would start with "traceroute www.apple.com" –  username Jun 26 '12 at 17:09
add comment

You generally cannot ping large servers so I would be focusing on traceroute instead of ping since your DNS appears to be resolving the Apple servers correctly. Or you could simply telnet to the http/https ports to see that a connection is made.

telnet www.apple.com 80

Since Apple is deploying more and more update files on a Content Delivery Network (CDN), the server I get will rarely be the same server you get for a download since the CDN spreads files out geographically or based on network connectivity. Not only is internet routing fickle and changeable from moment to moment, these CDN change hosts from day to day and even sometimes moment to moment.

Currently, Akamai is serving many Apple web sites and content. The updates (app store and traditional Lion and earlier SU server) but these two IP addresses from Apple seem to be related to the critical startup process of Software Updates and the App Store Update process on Lion before it shifts to the CDN.

  • 17.146.232.12 - server in San Jose, CA that answers as part of Software Updates
  • 17.172.192.35 - server in Maiden, NC that answers as part of App Store Updates

You could traceroute to those addresses to make sure your network has connectivity to them. Instead of ping since neither of these answer that traffic, you could insted use telnet to attempt a connection over the https port which they use for update traffic.

telnet 17.172.192.35 443

Good luck picking apart the issue that is preventing your updates. It's probably not DNS from the looks of things, but stranger things have happened than to rule that out with the data at hand.

If the ping errors at the end of your question persist, you can use nslookup to try alternate DNS to see if it's really your DNS reporting bad addresses.

mac:~ me$ nslookup
> server 8.8.8.8
Default server: 8.8.8.8
Address: 8.8.8.8#53
> apple.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   apple.com
Address: 17.172.224.47
Name:   apple.com
Address: 17.149.160.49
> www.apple.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
www.apple.com   canonical name = www.isg-apple.com.akadns.net.
www.isg-apple.com.akadns.net    canonical name = www.apple.com.edgekey.net.
www.apple.com.edgekey.net   canonical name = e3191.c.akamaiedge.net.
Name:   e3191.c.akamaiedge.net
Address: 23.60.173.15
> server 208.67.222.222
Default server: 208.67.222.222
Address: 208.67.222.222#53
> www.apple.com
Server:     208.67.222.222
Address:    208.67.222.222#53

Non-authoritative answer:
www.apple.com   canonical name = www.isg-apple.com.akadns.net.
www.isg-apple.com.akadns.net    canonical name = www.apple.com.edgekey.net.
www.apple.com.edgekey.net   canonical name = e3191.c.akamaiedge.net.
Name:   e3191.c.akamaiedge.net
Address: 23.1.141.15
share|improve this answer
    
this is sane, and deserves more than the one upvote i can give it –  username Jun 26 '12 at 17:22
    
This does not address the OP's problem as ping is failing to resolve the host name, not connect to the host. And in this case, the host does respond to pings. –  Old Pro Jun 27 '12 at 19:21
    
I did assume that the DNS error was transient and tried to explain some generalities. I have seen the same Akamai servers respond to pings some of the time in what I presume to be load shedding or other changes. The primary thrust of my answer is that things change so focus on routing. As I mentioned two very stable IP the OP can skip DNS entirely to isolate that as the true cause of the issue. –  bmike Jun 27 '12 at 21:34
    
Routing is not implicated in the OP's problem. The error is not "no route to host" or "Request timeout", which would be (possibly) routing problems, the error is "cannot resolve www.apple.com: Unknown host" which means ping cannot convert "www.apple.com" to an IP address. I would predict telnet and traceroute to fail with the exact same error on the OP's computer. –  Old Pro Jun 27 '12 at 22:39
    
What happens when you ping the IP instead of the domain? e.g. 17.172.224.47 –  mockman Jun 28 '12 at 2:57
add comment

Have you tried clearing the network prefs?

Go to /Library/Preferences/, delete/rename the SystemConfiguration folder and restart.

share|improve this answer
    
yes, tried it, didn't help.. –  tXK Jun 26 '12 at 14:25
add comment

There are two things I would try in this situation:

  1. Flush the DNS cache. This can be accomplished by running the command dscacheutil -flushcache. After running this command, attempt to run the dig and ping commands again. If they return the expected results, you should be good to go.
  2. Verify valid and responding DNS servers are responding to DNS queries. Open System Preferences -> Network. Unlock the lock icon in the lower left corner if it is locked. Select the network interface you are currently using from the left column and click the Advanced button. Click the DNS tab.

    Typically in the DNS tab, you will want to go with what ever is recommended by your ISP. If everything appears OK, consider swapping out the server addresses with one or more of the addresses from the list below:

    Google DNS

    8.8.8.8

    8.8.4.4

    OpenDNS (Not recommended if the device hosts an email Server)

    208.67.222.222

    208.67.220.220


Edit to add the following:

Another possible solution: Have you power cycled the networking equipment between your computer and your network connection? I have encountered inconsistent DNS lookups couple times with my Airport. Power cycling has resolved the troubles in at least one of those situations.

share|improve this answer
    
Tried 1, with dscacheutil and by killing some processes also and still nothing. As I was saying above, I also tried 2. No success –  tXK Jun 21 '12 at 12:42
    
I added another possible solution to my answer above. –  DMan Jun 21 '12 at 16:37
    
It has nothing to do with the router, my phone and tablet work just fine with apple servers. –  tXK Jun 21 '12 at 18:38
    
It sounds counter intuitive and may not solve your problem, but I would try power cycling the router anyway. I have encountered at least one similar situation where other devices on the network were working as expected while one was giving quirky results when running various DNS lookups. –  DMan Jun 21 '12 at 18:48
    
I did power cycled it two days ago... it's not the case. Actually I think I'll erase the partition and clean install Lion from scratch. –  tXK Jun 21 '12 at 19:12
add comment

I had a similar experience a while ago with getting updates on devices. It was specifically downloading updates for my iOS devices on my 2011 iMac running Lion.

At the time, I was also struggling to get to any Apple sites but could browse other sites very well and also download files.

After loads of searching, I found a forum post (unfortunately I can't find it again at the moment) that said it could be a DNS issue. I was using my local ISPs DNS and I changed it to googles DNS (8.8.8.8) and since immediately I could access all the apple sites.

share|improve this answer
    
I'm already using google's public dns, I tried several others in fact.. –  tXK Jun 21 '12 at 12:41
    
Changing the DNS server may lead to flushing of the local DNS cache -> change the servers to the ones provided by your ISP to see whether it makes a difference –  patrix Jun 21 '12 at 17:22
    
no difference.. so I guess it's some kind of virus/malware –  tXK Jun 26 '12 at 5:13
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.