Dnsmasq not working without internet connection in OS X Yosemite

dnsmasqlocalhostosx-yosemite

No0b here. I have been trying to setup a local environment for web development on OS X Yosemite using these approaches (http://passingcuriosity.com/2013/dnsmasq-dev-osx/ and http://mallinson.ca/osx-web-development/)

The culprit here is dnsmasq. It is supposed to automatically update /etc/hosts with folder-name.dev everytime I create new sites. It works well only when connected to the internet. When I'm offline, Google Chrome returns Unable to connect to the internet everytime I tried to access any .dev that wasn't registered in /etc/hosts.

I have checked the status of dnsmasq using LaunchRocket and it's stated as running. Also, running $ dig folder-name.dev @127.0.0.1 returns no error.

However, $ ping folder-name.dev returns ping: cannot resolve folder-name.dev: Unknown host. And when I run $ scutil --dns while offline, all I get is No DNS configuration available

Any idea how to get dnsmasq to run properly even without internet connection?

FYI, I am running clean install OS X 10.10 Yosemite on MacBook Pro 15" Late 2008.

Best Answer

Looks like it's "bug" with Yosemite. Check out this posting, https://github.com/BrianGilbert/OSXAegirInstaller/issues/34:

you could also try this.. https://github.com/joedj/yosemite_dnsfix (didn't appear to work for me though)

[...]

This has been escalated to Apple engineers by myself and I am awaiting a response, a workaround that I've confirmed works (but am not electing to use myself) is available at: http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-is-broken-and-what-you-can-do-to-fix-it

[...]

Response from applecare is that engineers said it's "Expected behaviour" no idea if they will ever fix it..

And from https://news.ycombinator.com/item?id=8969581:

So the response from Apple is that is expected behavior, and the applecare contact suggested I use the hack proposed at http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-i... (which I sent to them)

At this stage he doesn't know if it will ever get fixed.. no indication from engineering..

Related Question