I am using Pihole to block ads across my network and just does not seem to work on ubuntu, tried both my laptop and desktop.

Attached are screenshots of a windows machine an android device and the ubuntu laptop all showing dns configs and forbes website and they are all blocked except the ubuntu one. no ads are blocked on it.

  • 3
    I'm not sure enough to make a complete answer but this might be a dns caching issue on the client? – Jorge Castro Jan 7 '17 at 18:03

Your DNSMasq might be causing the DNS from the pihole to be overlooked.

Try disabling DNSMasq by commenting out the line dns=dnsmasq in /etc/NetworkManager/NetworkManager.conf

You can comment it out by running the following line:

sudo bash -c 'sed -i "s/dns=/#dns=/" /etc/NetworkManager/NetworkManager.conf'

Then you can check if the change took effect:

:~$ cat /etc/NetworkManager/NetworkManager.conf 


Then reboot the system for changes to take effect. After the reboot, check with nslookup to see that DNSMasq no longer is serving DNS. If the Server: line shows, that means that DNSMasq is still controlling DNS of the system.

:~$ nslookup google.com

Non-authoritative answer:
Name:   google.com

As you can see, my router IP is which means that DNS is controlled by my router instead of DNSMasq.

Hope this helps!

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.