Can't access apple.com webservers, App Store, nor Software Update 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.

; &lt;&lt;&gt;&gt; DiG 9.7.3-P3 &lt;&lt;&gt;&gt; apple.com any
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- 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
There are two things I would try in this situation:


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