• 4
Votes
name

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?

Is mDNSResponder running? Even if it is, try doing a sudo killall mDNSResponder and let launchdauto-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.

  • 0
Reply Report

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.

  • 0
Reply Report

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

  • 0
Reply Report