12

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?

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.

  • 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 Sep 14 '10 at 18:45
  • 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 Nov 10 '11 at 17:35
  • 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 Nov 10 '11 at 17:37
  • @Joel Thanks for the followup. It's nice to hear when an Answer has been helpful. – Spiff Nov 10 '11 at 20:25
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.

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

  • DNS is set via dhcp and shows correct dns servers. – Joel Coehoorn Sep 14 '10 at 17:16
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.