Mac OSX Lion DNS lookup order

Meik picture Meik · Jul 27, 2011 · Viewed 64.4k times · Source

After upgrading to Mac OSX Lion I figured out that /etc/hosts is not looked up in first place for name resolution anymore. This leads to some side effects like:

  1. Entries in /etc/hosts are resolved painfully slow
  2. You can't not override existing domains, e.g. 127.0.0.1 www.google.com
  3. If you get search domain entries from DHCP, let say .lan, and some funny guy configured localhost.lan to something else then 127.0.0.1 in the local DNS you can not reach your localhost anymore.

Is this behavior intended? Does it make any sense? And most important, how can I come back to the old behavior.

Answer

Jean-Baptiste MONIN picture Jean-Baptiste MONIN · Jul 28, 2011

I think he matter is Lion handles .local TLD differently because it's reserved for some Multicast DNS features (used by Bonjour). The only way i found to solve this issue is using a different TLD for development hosts (ie: .dev). It works fine for me, hope it's gonna be helpful to others!