dnsmasq quits with "abort" I installed dnsmasq using brew, and tried to run it as a service without success. This is how I installed it:

brew install dnsmasq
sudo brew services start dnsmasq


system.log just shows 2 lines over and over:

dnsmasq[52260]: setting --bind-interfaces option because of OS limitations
com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.


I tried running it manually, and I got similar results:

itsadok@mpb ~$ /usr/local/sbin/dnsmasq -d --interface=lo0 --port=50003                                                                                                                              [2.2.4]
dnsmasq: started, version 2.76 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack no-ipset auth no-DNSSEC loop-detect no-inotify
dnsmasq: setting --bind-interfaces option because of OS limitations
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 192.168.1.1#53
[1]    53009 abort      /usr/local/sbin/dnsmasq -d --interface=lo0 --port=50003


The exit status is 134, which is consistent with the abort message I'm seeing. Adding sudo does not help.

If I set the port number to 0, effectively disabling DNS, then the process runs indefinitely, but obviously with doing much of anything.

Any idea what's going on, or how I can debug this further?

I'm on Mac OS Sierra, 10.12.4
I had the same symptoms that were described in the question as well as a new and stale PID file in /var/run/dnsmasq.pid every 10 seconds. I am working with dnsmasq 2.77 installed via Homebrew, and macOS 10.12.5. I had 29,000+ hosts defined in /etc/hosts, which was fine until some point - upgrading macOS or dnsmasq, perhaps.

I made a backup of /etc/hosts and then removed all lines from the hosts file except as follows.

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

255.255.255.255 broadcasthost


After trying it with the minimal hosts file, I found dnsmasq working.

ps aux | grep dnsmasq
sudo lsof -n -i4TCP:53 | grep 'LISTEN'


But I didn't lose the definitions of hosts to block. They were migrated to the dnsmasq configuration file. A host definition in /etc/hosts looks like the following sample.

0.0.0.0 analytics.google.com


The corresponding definition in dnsmasq.conf looks like the following sample.

address=/analytics.google.com/0.0.0.0


Encouraged, I then added back to the hosts file all of my own definitions for my home LAN, my work LAN, some remote host nicknames, and local virtual hosts.