MacOS – DNS doesn’t work properly in OS X Yosemite

dnsmacos

There is a problem with resolving DNS in my OS X Yosemite.

Safari doesn't load web sites, ping says "unknown host" to google.com. DNS servers set to 8.8.8.8 and 8.8.4.4.

dig google.com

Gets proper information about google.com domain and others. nslookup also works properly.

I cannot reboot because I've got another user logged in and his data will be lost.

Restarting discoveryd doesn't seem to help. TCP dump shows no UDP activity when Safari or ping trying to resolve.

Best Answer

I experienced that problem on my MBP as well. I suppose it's a bug in Yosemite. Here's a related question: Yosemite cannot resolve domain names maybe it gives you some insight

My work around is flushing the DNS cache:

sudo discoveryutil mdnsflushcache

if that command doesn't work try this one instead:

sudo discoveryutil udnsflushcaches

I am not sure if this helped fixing it, but I did a PRAM and SMC reset as well.