Homebrew dnsmasq “Service exited with abnormal code: 2” (Mac OS X Sierra 10.12.6)

I installed dnsmasq through Homebrew. Unfortunately it constantly crash and is resumed by launchd through brew services launch script.

This is the log:

Jun 11 10:45:33 MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq[48386]): Service exited with abnormal code: 2 Jun 11 10:45:33 MacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. 

I set it up following some tutorials, this is my settings.

#/private/etc/Hosts       localhost broadcasthost ::1             localhost  fe80::1%lo0     localhost  # [...]               local.web 0:0:0:0:0:ffff:7f00:1   local.web fe80::1%lo0             local.web               fullpipeumbrella.loc 0:0:0:0:0:ffff:7f00:1   fullpipeumbrella.loc fe80::1%lo0             fullpipeumbrella.loc  # [...]               localhost.demo1.com 0:0:0:0:0:ffff:7f00:1   localhost.demo1.com fe80::1%lo0             localhost.demo1.com  #/usr/local/etc/dnsmasq.conf  domain-needed bogus-priv no-resolv server= server= 

This is the output of brew services list:

$   brew services list Name    Status  User     Plist dnsmasq started root     /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist httpd   stopped           php     started username /Users/username/Library/LaunchAgents/homebrew.mxcl.php.plist php@7.1 stopped           php@7.2 stopped           

And the output of ps, $ ps -e | grep -v grep | grep dnsmasq:

   65 ??         0:02.31 /usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foreground -C /usr/local/etc/dnsmasq.conf 

Finally I made a test with dscacheutil:

$   dscacheutil -q host -a name fullpipeumbrella.loc name: fullpipeumbrella.loc ipv6_address: ::ffff: ipv6_address: fe80:1::1  name: fullpipeumbrella.loc ip_address: 

Thanks in advance… 🙂