I run a small development environment on my home network and was sick of having to edit the /etc/hosts file every time I needed to test a new website. I read around and found dnsmasq to be the best solution for my needs. I've installed it as described here and tested it, and it works great. When I run it, anything.dev directs to one Linux box (10.x.x.61), anything.test to another (10.x.x.62).
Unfortunately I have run into a problem starting dnsmasq whenever I have internet sharing turned on (which is all the time. My work laptop has no WiFi card, and so I need to share my wifi from the Macbook Pro to the Dell via ethernet). When I try to start the service I get this:
CRAINEs-MacBook-Pro:etc craine$ dnsmasq --test dnsmasq: syntax check OK. CRAINEs-MacBook-Pro:etc craine$ sudo /System/Library/StartupItems/DNSMASQ/DNSMASQ Password: /System/Library/StartupItems/DNSMASQ/DNSMASQ: line 1: #!/bin/sh: No such file or directory Starting DNSMASQ dnsmasq: failed to create listening socket for 192.168.2.1: Address already in use
Internet sharing hands out 192.168.2.x addresses to connected clients. As soon as I turn off Internet Sharing, I can start the service and names get resolved.
CRAINEs-MacBook-Pro:etc craine$ sudo /System/Library/StartupItems/DNSMASQ/DNSMASQ Password: /System/Library/StartupItems/DNSMASQ/DNSMASQ: line 1: #!/bin/sh: No such file or directory Starting DNSMASQ
However, when I restart internet sharing, the work laptop can't resolve domain names anymore. I thought it might be a DHCP conflict, so I tried commenting out all of the DHCP related items in the dnsmasq.conf file, but still can't start the service with internet sharing enabled.
My question is this: Why is dnsmasq trying to bind to 192.168.2.1 when my machine's IP is 10.x.x.2 when there should be no interfaces with that 192 address? How can I change that address it binds to, as I don't see it anywhere in the configuration files?
If you need more info about my setup, please let me know. Thanks.