3

I noticed Mavericks prefers the DNS server to /etc/hosts (scutil --dns). There used to be a good 'ol "order hosts,bind". Is there anything equivalent for Mavericks so my hosts file is consulted before reaching out to the DNS server? Thanks.

klanomath
  • 64,996
  • 9
  • 126
  • 195
  • 1
    Please elaborate your thoughts about lookup order changes and add some examples. On my system the order is hosts->mDNS->DNS (except using dig, host and nslookup of course) – klanomath Feb 24 '15 at 20:34
  • Additionally check gordon's answer [here](http://apple.stackexchange.com/questions/158117/os-x-10-10-1-etc-hosts-private-etc-hosts-file-is-being-ignored-and-not-resol) – klanomath Feb 24 '15 at 22:49

2 Answers2

1

(Cross-posting my Reddit answer here.) In my experience, it's more of an additional priority issue: IPv6. It hit me in Mavericks, but probably dates back to Lion. I develop on my local machine using /etc/hosts aliases to route requests through nginx, but on slow Wifi with slow DNS, it will often hit a 5-second timeout before bailing out on IPv6 and trying IPv4, realizing that there's a relevant /etc/hosts entry, and resolving that way. Not very convenient to have +5s tacked onto my recode-reload cycle.

Adding a ::1 example.com line to go along with my 127.0.0.1 example.com lines resolved the issue for me.

chbrown
  • 267
  • 1
  • 3
  • 9
0

I've noticed this dns authority priority inversion in 10.10.2 (Yosemite) but not back in Mavericks.

I just started this thread. https://www.reddit.com/r/mac/comments/2y22sj/yosemite_ignoring_localhost_etchosts_redirects/

Matthew Du Puy
  • 111
  • 1
  • 2