Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 servers, not even in Safari/Chrome/Firefox.

If I try to ping it doesn't find the host, but when I do a dig 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 any and ping

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

; <<>> DiG 9.7.3-P3 <<>> 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

;         IN  ANY

;; ANSWER SECTION:      3542    IN  TXT "v=spf1 ip4: ~all"      86342   IN  SOA 2010076647 1800 900 2016000 86500      86342   IN  NAPTR   50 50 "se" "SIPS+D2T" ""      86342   IN  NAPTR   90 50 "se" "SIP+D2T" ""      86342   IN  NAPTR   100 50 "se" "SIP+D2U" ""      3542    IN  MX  10      3542    IN  MX  10      3542    IN  MX  10      3542    IN  MX  10      3542    IN  MX  10      3542    IN  MX  20      3542    IN  MX  20      3542    IN  MX  20      3542    IN  MX  20      3542    IN  MX  20      3542    IN  MX  100      1731    IN  A      1731    IN  A      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS

;; AUTHORITY SECTION:      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS      86342   IN  NS

;; ADDITIONAL SECTION: 85475   IN  A 85475   IN  A  85475   IN  A 85475   IN  A 85475   IN  A 85475   IN  A

;; Query time: 5 msec
;; WHEN: Tue Jun 19 08:08:40 2012
;; MSG SIZE  rcvd: 918

And the ping:

➜  ~  ping -c 1
ping: cannot resolve Unknown host

➜  ~  ping -c 1
ping: cannot resolve Unknown host
share|improve this question and are different things. What does dig report for – molbdnilo Jun 19 '12 at 4:16
dig returns: ;; ANSWER SECTION: 1365 IN CNAME 14 IN CNAME 12160 IN CNAME 4 IN A – 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
Did you check your hosts file? Launch Terminal, type in sudo nano /etc/hosts/ and check if there are any irregular entries concerning Could it be that an outgoing firewall - like Little Snitch - is blocking the connection by an accidental added rule? – Saaru Lindestøkke Jun 21 '12 at 20:59
@BartArondson +1, but that should be /etc/hosts not /etc/hosts/. – bahamat Jun 23 '12 at 0:11
up vote 2 down vote accepted

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 "" in the results and see what you come up with. Then try

sudo killall -HUP mDNSResponder

to actually flush the cache and try ping again.

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

user$ nslookup

Non-authoritative answer:   canonical name =    canonical name =   canonical name =

So you should be able to ping,, and (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

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

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

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

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 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.

  • - server in San Jose, CA that answers as part of Software Updates
  • - 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 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
Default server:

Non-authoritative answer:

Non-authoritative answer:   canonical name =    canonical name =   canonical name =
> server
Default server:

Non-authoritative answer:   canonical name =    canonical name =   canonical name =
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 Unknown host" which means ping cannot convert "" 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. – mockman Jun 28 '12 at 2:57

Mea culpa: I misread your question and thought you wrote that you had already tried connecting to 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 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" – username Jun 26 '12 at 17:09

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 ( 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

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

Which DNS servers are you using?

$ networksetup -getdnsservers Wi-Fi


$ 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 +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 – Pro Backup Jun 26 '12 at 15:37

Your Answer


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.