I have installed and started dnsmasq, using brew install dnsmasq and sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist respectively. I tried to use the "adress" function inside dnsmasq.conf and added this as an example:


However, accesing facebook from my browser does not send me to localhost. I also tried starting it and specifying the conf file, but it's in the default path anyway.

It might also be that it doesn't work at all, but there is no way to tell.


First, does the file /etc/resolv.conf have a nameserver entry with the IP address of the machine running dnsmasq? If not, you're browser is just using whatever IP address appears in /etc/resolv.conf for a DNS name server. You can discover what IP address your browser is using by running nslookup in a terminal window, and issuing the server command.

Second, does dnsmasq.conf have a resolv-file parameter? If you want to use dnsmasq to aggregate DNS traffic, or just block certain sites, then you probably want to mv /etc/resolv.conf /etc/dnsmasq.resolv and then fill in the resolv-file=/etc/dnsmasq.resolv parameter.

Don't forget to stop and start dnsmasq after these changes.

  • My resolv.conf is this (excluding commented lines) nameserver and this is in dnsmasq.conf resolv-file=/etc/resolv.conf. I have had that from the beginning and it doesn't work. – DisplayName Dec 13 '15 at 22:50

I had to set two different DNS servers in the System Preferences, the one positioned at the top being

  • Remove the second entry unless it points to a different but identically configured DNS server – roaima Dec 14 '15 at 0:04
  • Actually this stopped working now. What a horrible program dnsmasq is. – DisplayName Dec 14 '15 at 0:45
  • @roaima If I do that, all webpages I access load forever. – DisplayName Dec 14 '15 at 0:49
  • Then you've not configured it properly yet. If you have two DNS resolvers you get a 50% chance of using your custom one. – roaima Dec 14 '15 at 9:09
  • @roaima I've followed like 5 different guides including official ones. – DisplayName Dec 14 '15 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.