dnsmasq not working without internet connection in OS X Yosemite

2

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.

Davin Fabian Devara

Posted 2014-11-04T06:48:08.710

Reputation:

Related: Set DNS server on OS X even when without internet connection on Server Fault (without a solution for Yosemite today).

– Arjan – 2015-04-06T13:34:58.983

Answers

2

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..

SteveSTL

Posted 2014-11-04T06:48:08.710

Reputation: 121

Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. That way, should the linked page ever change or become invalid for any reason, the answer will still be useful to visitors to [su].

– a CVn – 2015-02-01T13:40:49.700

Ah yes, the good old Apple engineering "expected behavior". It's either that or "reinstall the OS". – user1533191 – 2018-06-14T02:06:56.060