MacBook can't use internet, but nslookup and ping both work

12

1

I have a user with a new high-end MacBook Pro that can't use the internet. He can connect to either our wired or wireless network and do things like browse file shares, but can get no further.

When I brought the machine in for testing, I found that I could do an nslookup just fine, and I'm able to ping addresses returned by nslookup just fine. I'm even able to bring up web pages by entering the IP address into the address bar directly. However, when I try to ping the domain name rather than the IP address, it just sits there. So apparently I can either do name resolution or communicate with an address, but not both at the same time.

Again, these symptoms occur on both the wired and wireless network. Other machines on our network, including a few other Macs, don't have this issue.

Any ideas?

Joel Coehoorn

Posted 2010-09-14T17:01:01.340

Reputation: 26 787

Answers

8

Is mDNSResponder running? Even if it is, try doing a sudo killall mDNSResponder and let launchd auto-relaunch it. (If you'd already tried rebooting the system and the problem persisted, then this probably isn't the cause.)

mDNSResponder is a critical part of Mac OS X's DNS resolver infrastructure nowadays. A few tools like nslookup contain their own DNS resolver code or call low-level APIs that avoid mDNSResponder and use a more traditional Unix DNS resolver library, but most apps and tools that just call the normal APIs will be relying on mDNSResponder to do name resolution.

You may also want to check how you have DNS configured in the Network panel of System Preferences, and look at /etc/resolv.conf (note: no 'e' in "resolv"). ipconfig getpacket en0 (replace en0 with your primary network interface's BSD-layer identifier) can be useful to see what DNS server information your machine is getting from DHCP. See also the "LOGGING" section of the mDNSResponder(8) man page for more tips on getting troubleshooting/debugging information out of mDNSResponder.

Spiff

Posted 2010-09-14T17:01:01.340

Reputation: 84 656

This has persisted across several reboots, but the fact that nslookup returns an address while anything else that needs to do resolution fails still indicates mDNSResponder as a good candidate for the problem. – Joel Coehoorn – 2010-09-14T18:45:25.560

Amazing what difference another year's experience makes. I come review this today because someone voted for the question, and most of your answer is now 2nd nature to me, where before I was shooting blind. That said, I've said this before now, but mDNS/Bonjour is a great steaming pile that Apple should never have unleashed into production equipment. – Joel Coehoorn – 2011-11-10T17:35:16.753

Oh, and the student ended up resolving this before we had the machine back to try this, but reading the symptoms and suggestion now, I'm certain this was the problem, and that re-installing the Bonjour service may have been needed. – Joel Coehoorn – 2011-11-10T17:37:01.010

@Joel Thanks for the followup. It's nice to hear when an Answer has been helpful. – Spiff – 2011-11-10T20:25:02.220

2

I found that the root cause of this problem on many of my Macs (well, Hackintoshes) was sleeping/suspending to disk. If this fails, on next boot the mDNSResponder is in a corrupt state, and the sudo killall mDNSResponder command fixes it.

Corey Larson

Posted 2010-09-14T17:01:01.340

Reputation: 133

1

Since this crucial but underdocumented command changes maddeningly in different versions of MacOS, I copy-and-paste below the super-helpful reference list from

"COOLEST GUIDES ON THE PLANET" by Neil Gee https://coolestguidesontheplanet.com/clear-the-local-dns-cache-in-osx/

How to clear the local DNS cache (when URLs are just not resolving the way you want it)

sudo killall -HUP mDNSResponder (OSX 10.10.4, 10.11.0, macOS Sierra 10.12.0)

sudo discoveryutil mdnsflushcache (OSX 10.10.0 – 10.10.3)

sudo killall -HUP mDNSResponder (OSX 10.9,10.8,10.7)

sudo dscacheutil -flushcache (OSX 10.5,10.6)

and also includes Windows and Linux

smci

Posted 2010-09-14T17:01:01.340

Reputation: 233

1

Perhaps you have manually specified DNS servers in your Mac settings? Please check your settings as it is shown here, remove any DNS servers you may have there, replace with your access point IP (or even just leave it empty, DNS should be set via DHCP).

Andrejs Cainikovs

Posted 2010-09-14T17:01:01.340

Reputation: 2 611

DNS is set via dhcp and shows correct dns servers. – Joel Coehoorn – 2010-09-14T17:16:25.847

0

I really struggled with this and tried all the steps. what worked for me was going into network preferences and deleting both the ethernet and airport adapters then re-adding them

Ryan

Posted 2010-09-14T17:01:01.340

Reputation: 1