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.
MacOS – Mac OS X Mavericks DNS name lookup order change
dnshostsmacosNetwork
Related Question
- Redirect to an alternative DNS Lookup server depending on domain request
- MacOS – Mac Mavericks 10.9 DNS problem with specific addresses
- MacOS – Use “options ndots:2” in global DNS resolver
- How to add a wildcard host entry to Mac OS X Server’s DNS
- Mac doesn’t use local dns for .local
- MacOS – Why is there a hosts.equiv file in the /etc folder
- Can’t ping local devices by network name after DNS change
- Dns lookup specified in /etc/hosts and then dscacheutil != differ from dig, host, chrome
Best Answer
(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 my127.0.0.1 example.com
lines resolved the issue for me.