4

I'm using dnsmasq for my local develop environment. When I'm connected to network everything is fine but then I disconnect form network, local domain doesn't work. (Safari or FireFox show me "You are not connected to network"

Thanks!

kubens
  • 264
  • 3
  • 5

3 Answers3

3

There are a number of reasons dnsmasq might not be working for you after the Yosemite upgrade. First, check to make sure you have your localhost (127.0.0.1) set in the first position of your System Preferences > Network > Advanced for the network devices you want dnsmasq to work for. dnsmasq Network Settings

*Note - I'm using Google's DNS Servers here which are the 8.8.x.x ip addresses in the screenshot image.

Following the instructions here: https://blog.wwwjfy.net/2014/06/03/some-solutions-to-some-problems-in-yosemite-beta/

I was able to "kickstart" dnsmasq by running the following command:

sudo launchctl kickstart system/homebrew.mxcl.dnsmasq

Ultimately though, I needed to update my plist file to the following in order for the service to startup when the computer boots up.

/path/to/homebrew.mxcl.dnsmasq.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>homebrew.mxcl.dnsmasq</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/opt/dnsmasq/sbin/dnsmasq</string>
        <string>--keep-in-foreground</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

Hope that helps.

Justin Levi Winter
  • 2,327
  • 2
  • 17
  • 30
  • 1
    Thank you for your reply about network settings but doesn't work :( dnsmasq work after reboot because then I have a internet connection local domain work. Problem is then I'm disconnect from internet – kubens Oct 21 '14 at 16:12
1

I experienced the same issue on Yosemite. I do not have a proper solution yet, for the time being, I have to manually add host to /etc/hosts if offline. I wish that Apple would fix discoveryd in the next version, this same problem is giving me pain too

Trung Lê
  • 5,188
  • 5
  • 27
  • 26
0

Check your files at /etc/resolver/ directory and delete them and try again.

Scott Yu - builds stuff
  • 11,673
  • 8
  • 42
  • 55