Tuesday, January 13, 2015

Why DNS in OS X 10.10 is broken, and what you can do to fix it

As Technica explains Why DNS in OS X 10.10 is broken, and what you can do to fix it "Resolving DNS names, resolving Bonjour machine names, resolving Bonjour service advertisement and discovery, and opening ports in NAT gateways to allow incoming network connections are all jobs that have been performed by the mDNSResponder daemon. This was introduced with Mac OS X 10.2 Jaguar back in 2002. mDNSResponder is written in C and has been released as open source by Apple, and it has found its way to all kinds of non-Apple operating systems and hardware.

Again, as of OS X 10.10, mDNSResponder has been replaced by discoveryd. Curiously, discoveryd is (re)written in C++, not exactly one of Apple's favorite languages. It's not on Apple's list of open source projects. And apparently, the responsible people at Apple haven't been reading their Joel on Software. As per Joel Spolsky's dire warnings against rewriting software from scratch, discoveryd has its share of bugs. For instance, when the system is unable to resolve DNS names, discoveryd log messages indicate that it doesn't recognize the replies from the DNS server to its own requests. discoveryd is also a frequent guest in the CrashReporter logs."

It says it's the cause of the following issues (of which I've experienced the first three):

  • Random failures to resolve DNS names
  • Duplicate machine names
  • Very inconsistent wake on demand
  • Impossible to reach services running on a Mac from the outside
  • Very flakey Wide Area Bonjour registration

They provide instructions of how to restore mDNSResponder from a 10.9 backup and replace 10.10's discoveryd with it. I haven't tried this, but if it doesn't improve in a future update I just might.


The Dad said...

I suppose this has something to do with why, when I look at the available computers on my network, it might say, "Hilary's iMac(2)" or even worse, give me an error that an assigned IP address is already in use? You'll have to keep me up to date on that.

Howard said...

Yes I've seen the same thing and it's the 2nd bullet item. So far, I've just renamed the machine in the Sharing System Preferences removing the "(2)" and it worked fine.