I recently installed dnsmasq so I could use wildcard lookups for *.local addresses using these instructions.
The only difference was that mine was setup to resolved .local instead of .dev, like so:
address=/.local/127.0.0.1
It was working great when directly connected to a modem, but when connecting through, say, a public WiFi it was unable to resolve anything!
$ dnsmasq
dnsmasq: failed to create listening socket for 192.168.1.129: Permission denied
As an interim solution I removed dnsmasq:
$ sudo port uninstall dnsmasq
And then in my network preferences, I ran Diagnostics which detected a "problem" with my DNS settings. I clicked the button to revert those changes and the WiFi began to work again.