I have a service running on localhost on MacOS High Sierra.

curl foo.test 

does not work, but

curl localhost 


To get to my setup, I installed dns using homebrew,

brew install dnsmasq

added my configuration to /usr/local/etc/dnsmasq.conf,


and added a resolver file /etc/resolver/test:


I've spent a day trying dig foo.test scutil --dns dscacheutil -q host -a name foo.test and nothing worked.

My eventual issue was not covered anywhere else, so I'm answering it here for someone else.


tl;dr make sure you start dnsmasq as root.

To diagnose this problem, I used Console.app, and searched for dnsmasq.

  1. My first problem revealed in the logs:

    failed to create listening socket for Address already in use
    FAILED to start up

To fix this, make sure dnsmasq is stopped:

brew services stop dnsmasq

then use Activity Monitor.app to kill any old dnsmasq processes.

After the socket conflict was removed, I attempted to start dnsmasq again:

brew services start dnsmasq # does not work

and now the logs in Console.app show

failed to create listening socket for Permission denied
FAILED to start up

To fix this, I restarted the service as root:

brew services stop dnsmasq
sudo brew services start dnsmasq


curl foo.test


After this journey, I revisited all those dnsmasq help articles I read. The sudo was there all along and I skimmed over it. I'm posting this for the next person that forgets to start dnsmasq as root.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .