Pi-hole + Unifi USG ... appears to resolving dns queries but not blocking ads?

Expected Behaviour:

I have disabled the Unifi dhcp server via the settings panel:

And I have enabled the dhcp server through the pi-hole admin panel. My understanding is that this means that pi-hole should be resolving DNS for all clients on my network.

Actual Behaviour:

My client (a mac) is still loading ads from domains that are in the blocklists loaded on my pi-hole. For example doubleclick still loads:

Even though my diagnostic file says that doubleclick is blocked:

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] track.leady.cz is 0.0.0.0 via localhost (127.0.0.1)
[✓] track.leady.cz is 0.0.0.0 via Pi-hole (192.168.1.131)
[✓] doubleclick.com is 216.58.194.174 via a remote, public DNS server (8.8.8.8)

Debug Token:

debug token: 1ntepdsrni

Please check whether you have IPv6 connectivity: http://www.test-ipv6.com/

It may be that your router is still handing out DHCP servers over IPv6.

I have IPv6 disabled in my Unifi network config. Here are the results from the test:

Did you clear the DNS cache on the Mac? This command will do it:

sudo killall -HUP mDNSResponder

Just tried it...still seeing ads load. I think I may have found another clue...i'm seeing a lot of queries from opendns

do I need to disable that?

These are not "from" opendns, they are a request "for" that domain from the indicated client.

From the Mac terminal, what is the output of nslookup pi.hole

Also, please generate a debug log from Pi-Hole, upload it and post the token here.

image

debug token: 1ntepdsrni

This nslookup was run from the Mac terminal, and not the Pi terminal? I wouldn't expect to see the loopback address on the Mac for DNS resolver.

What DNS is shown for the Mac in System Preference > Network > Advanced > DNS?

Here's the screenshot of my DNS settings:

Yep, I ran the command from my Mac's terminal

Your debug log shows that Pi-Hole is working normally, except for the web admin interface.

What is the output of these commands from the Mac terminal:

nslookup cnn.com

nslookup flurry.com


image

I was having issues with the lighttpd service being able to start to I manually removed it and reinstalled it...so I am able to access the web admin UI now.

The second output shows that the expected reply of 0.0.0.0 (flurry.com is a domain that appears on the original blocklists) was not received. The Mac is getting DNS replies from a source other than Pi-Hole.

Are you absolutely certain that these nlsookups are from the Mac terminal only - and not a Mac terminal that is in a ssh session to your Pi? The Pi uses the loopback IP for DNS, but your Mac should not. Here is the output of the command from my Mac using Pi-Hole at xxx.155.

nslookup pi.hole

Server: 192.168.0.155
Address: 192.168.0.155#53

Name: pi.hole
Address: 192.168.0.155

Yep, 100% sure.

hmm...how can I tell what that source is

This command shows the true order of the nameservers your Mac is using.

scutil --dns

DNS configuration

resolver #1
  search domain[0] : lan
  nameserver[0] : 127.0.0.1
  if_index : 8 (en0)
  flags    : Request A records, Request AAAA records
  reach    : 0x00030002 (Reachable,Local Address,Directly Reachable Address)

still getting 127.0.0.1..

what's also strange is that everything seems to be working fine on my ios device

other clients on my network appear to be working as well...so it's definitely isolated to just my primary machine.

Are you running any software on the Mac that might be controlling DNS settings? Which browsers are in use?

1 Like

wow...figured it out...did not realize that my work machine had opendns umbrella installed on it. i just disabled it and everything is working great now. thanks for all your help today @jfb :bowing_man: