1

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:

address=/.facebook.com/127.0.0.1

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.

2 Answers 2

1

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.

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

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

6
  • Remove the second entry unless it points to a different but identically configured DNS server
    – roaima
    Dec 14, 2015 at 0:04
  • Actually this stopped working now. What a horrible program dnsmasq is. Dec 14, 2015 at 0:45
  • @roaima If I do that, all webpages I access load forever. Dec 14, 2015 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, 2015 at 9:09
  • @roaima I've followed like 5 different guides including official ones. Dec 14, 2015 at 10:31

You must log in to answer this question.

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