Pi-hole no longer working as primary DNS - With iOS 16

Expected Behaviour:

Pi-hole to consistently block ads in the adlist.

Actual Behaviour:

Pi-hole is no longer blocking the bulk of my ads. I can see from the dashboard it's still analyzing queries and blocking some.

However most of the sites I visit where I normally don't see ads I'm now seeing ads. Even on my mobile devices I'm seeing ads in the apps where I previously didn't see any ads.

Currently my DNS is setup with my Pi-hole (10.1.1.10) as the primary and I have Google (8.8.8.8) as my secondary on my main network gateway.

search localdomain

nameserver 10.1.1.10

nameserver 8.8.8.8

nameserver 10.1.1.254

nim6us@MacBook ~ % nslookup pi.hole

nslookup flurry.com

nslookup flurry.com 192.168.1.28

Server: 10.1.1.10

Address: 10.1.1.10#53

Name: pi.hole

Address: 10.1.1.10

Server: 10.1.1.10

Address: 10.1.1.10#53

Name: flurry.com

Address: 0.0.0.0

;; connection timed out; no servers could be reached

Now if I change the network settings on my laptop to static and only look exclusively at Pi-hole (10.1.1.10) for DNS the blocking works as expected. However if I change it back to automatic DNS, it sees my Pi-hole (10.1.1.10) as primary and Google (8.8.8.8) as secondary, but for some reason it's not blocking as expected.

This is happening on all devices on my network. The only change I made was upgrading to Pi-hole v5.12.1 a few days ago, but I'm unclear if that's what's caused the issue. This Pi-hole instance has been running for years without issue, so I'm confused what changed to affect all my devices.

Debug Token:

https://tricorder.pi-hole.net/IqpYESfR/

EDITED TITLE: I have edited the thread title as the root issue appears to be with iOS 16 and I wanted to give better visibility to the issue.

If you have Google 8.8.8.8 as a secondary on your main network, that seems like the reason that you're not seeing the expected blocking. Some of the lookups will be going through your Pi-hole on 10.1.1.10 and those will have ad blocking. The rest will be going through Google 8.8.8.8 and those are never seen by Pi-hole and will not have ad blocking.

If your router's DNS is that 10.1.1.254 entry, then some of the lookups are probably going through that too, and similarly they will not be seen by Pi-hole and will not have ad blocking.

Log in to your router and find the DHCP section and make sure it's only giving out the Pi-hole's DNS address, not Google's too. Then disconnect and reconnect your Mac from your network and have another look at your nameservers using whatever you did above.

You can also see it in the MacOS's graphical interface --> Apple icon / System Preferences... / Network / select the network interface that's green and says "Connected". On that screen you can see your Mac's IP address, router and DNS. Use --> Advanced / DNS to look in detail at the DNS servers available if needed.

1 Like

Thanks for the thoughtful reply! I guess the confusing part is I've had this setup working for years. The only reason I have Google as the secondary is in case my Pi-hole is offline.

Here's my router/gateway settings

Here's my Mac's DNS settings

I was looking at the Pi-hole debug logs myself and this stands out

I'm not exactly sure what that means (currently Googling) but that can't be good and is likely part of the problem, if you have any further thoughts.

I may have found what the problem could be, looking at the address table on my Pi-hole

Then looking at my config

I think that I may need to change my config PIHOLE_INTERFACE to look at bond0 or docker0 instead of eth0, but I'm just inferring at this point. I'm unsure what change I should make.

You have two interfaces, eth0 (SLAVE) & eth1 (SLAVE), that are bonded resulting in a bond0 (MASTER) interface with an IP configured.

Plus a docker0 interface with IP implying that you're running Docker on the host.
Do you run Pi-hole in a Docker container or are you running it directly/bare metal on the host?

I’m running it in a Docker container on my Synology NAS. So does that mean I need to change the interface in my config file?

Well that docker0 IP 172.17.0.1 is outside your LAN's subnet which I suspect to be 10.1.1.0/24.
That would mean your clients wont be able to address/reach that IP for DNS.
I am not that familiar with Docker on Synology but try search here on Discourse!

In the end, below ones run on a client (Windows/MacOS/Linux) need to reply similar with the 10.0.0.2 IP being my own Pi-hole host:

C:\>nslookup pi.hole 10.0.0.2
Server:  ph5a.home.dehakkelaar.nl
Address:  10.0.0.2

Name:    pi.hole
Address:  10.0.0.2
C:\>nslookup pi-hole.net 10.0.0.2
Server:  ph5a.home.dehakkelaar.nl
Address:  10.0.0.2

Non-authoritative answer:
Name:    pi-hole.net
Address:  3.18.136.52

Only then can you proceed to configure your router DHCP service to advertise the Pi-hole IP for DNS to the clients (as the only DNS server).

I booted up a shell on my own Synology and it seems nslookup is available.
So you could also try do below one on the Syno to check at least if something is answering on that docker0 IP:

nslookup -class=chaos -type=txt version.bind 172.17.0.1

Or on that bond0 interface:

nslookup -class=chaos -type=txt version.bind 10.1.1.10

Answer should be similar like below:

dehakkelaar@nas:~$ nslookup -class=chaos -type=txt version.bind 10.0.0.4
Server:         10.0.0.4
Address:        10.0.0.4#53

version.bind    text = "dnsmasq-pi-hole-2.87test8"

Looks like it is responding... but unclear how this helps.

I took a punt and changed my config to bond0, no surprise IPv4 is passing but IPv6 is failing.

You dont need IPv6 for your clients to resolve DNS.
Clients are able to query for IPv6 addresses via IPv4 and vice versa:

pi@ph5b:~ $ dig +short @127.0.0.1 google.com a
172.217.168.206
pi@ph5b:~ $ dig +short @127.0.0.1 google.com aaaa
2a00:1450:400e:80c::200e
pi@ph5b:~ $ dig +short @:: google.com a
172.217.168.206
pi@ph5b:~ $ dig +short @:: google.com aaaa
2a00:1450:400e:80c::200e

KISS

EDIT: Ow could you copy/paste the text output pls instead of screenshots?
Is easier to read and copy/paste from plus for people searching for similar issues.
With the mouse you can highlight/enclose the text code output with the </> button before posting here so the code gets formatted like above ^

Thanks I appreciate all the help, I'll try and format my responses going forward. :+1:

However what are you suggesting at this point, to disable IPv6? Even with the settings changed to bond0 I'm still seeing the same behavior from my original post.

1 Like

Below bit?

That is probably due to:

EDIT:

Leave it as it is if its working.
That debug message is only a sort of warning.

Yeah I'm still not having all my adds consistently blocked unless on the device I point DNS specifically at the Pihole.

While Chris' explanation sounds plausible, I don't understand why it's been working with that setup for as I said years. Then all the sudden it just stops working? Something must have changed somewhere. :face_with_raised_eyebrow:

I dont know how you've configured Pi-hole in your network.
Did you configure the DNS IP in the router WAN/Internet settings or LAN DHCP service settings?
What does below one show (wait for 10 seconds timeout) ?

pihole-FTL dhcp-discover | grep 'Received\|dns-server'

You also have to consider that your router could push its own DNS server(s) to its clients via IPv6 router advertisement.
Do you have IPv6 enabled on your LAN and does your ISP support IPv6 upstream?

EDIT: Ow from that screenshot you posted in the OP it seems your configuring it in the WAN section.
What DNS server is configured now in that field?
Is it solely the Pi-hole IP or is there another like in the OP?

EDIT2: Ow sorry, it wasnt in the OP.
I mean this one:

@deHakkelaar Thanks for all the help, I'm a little fried tonight so will have a look a bit later.

You're right though lot of complexity; I have my UniFi Dream Machine that my Synology connects to, that runs Docker that's managed by Portainer that Pi-hole runs off of, so right there we've got 5 levels of potential problem causers. LOL!

1 Like

One more for the road :wink:
A large number of router manufacturers incorporate dnsmasq into their consumer routers and maybe even yours too.
And as Pi-hole has dnsmasq embedded into its code, have a read below how Pi-hole chooses when two (EDIT: or more) DNS servers are configured for upstream:

And there is a FAQ:

I wasn't aware you were running in Docker or using a bonded interface when I wrote that reply. Your initial post seemed like a common case where someone has a simple home network and the router turns out to be handling some queries, or using ipv6 to handle some queries, leading to some clients effectively bypassing the Pi-hole.

Regardless of the cause, if you're on the Mac and have multiple DNS servers configured in the OS, which you do, macOS's mDNSResponder service will send queries to all of them and go with the server which responds first. I suspect that means that Pi-hole and your router see most of it, and Google less so since it's external to your network. But even so, any queries hitting your router won't have blocking.

It may be that a recent OS or app update somewhere in the mix has subtly altered the timings, making your router a slightly quicker responder, leading you to see a big drop in Pi-hole blocking.

So I think actually just changing the IPv4 settings from eth0 to bond0 has done the trick. I had tunnel vision last night and was just testing with my MacBook and iPhone, however today when I checked a Windows machine and my iPad the blocking was working properly. I must just have cached settings on my iPhone and MacBook from all the tinkering.

However I do have one final problem I'm editing /etc/piphole/setupVars.conf to change the settings, but every time the container is restarted it reverts back to eth0. How do I get the config to keep the change to bond0?

I'm not that well versed in Docker but as Pi-hole is running in a container, I suspect that bond0 interface doesnt exist inside the container.
I suspect the container has its own interface inside the container which is most likely eth0.
And traffic gets port translated from inside to outside the container with below ones:

    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
      - "80:80/tcp"

Maybe someone with more Docker foo can help?

EDIT: Also:

1 Like