Work around Android's sneaky DHCP behaviour

So, an Android phone was still getting IP addresses for blacklisted domains after using pi-hole for DNS, even though my other devices weren't.

Looked at the network connection status and sneaky old Google had added 8.8.8.8 to the DNS servers list, so the DNS servers looked like [192.168.8.4, 8.8.8.8]

I added a second IP address to my DNS server's interface, then changed my dhcp server to push out both those IP addresses. (note that I have samba running an AD server which uses my pihole as the upstream, so I have more control over the dns and the dhcp than pihole gives you normally)

The DNS servers then looked like [192.168.8.4, 192.168.8.5] without google's DNS appended.

I'm guessing that Google currently only add a second DNS when 'redundancy' isn't already provided in your network.

I'd like to see pihole come with an option to enable a second IP address. I use it to block inappropriate content that isn't family friendly so that my family can browse safely so not happy with device vendors actively working around parental controls.

There is an open PR, but currently on hold (@deHakkelaar)

2 Likes

Pi-hole would only be able to do this if it is the DHCP server.

The workaround for now if you are using Pi-hole as DHCP server is to add a second DNS server assignment in a new dnsmasq configuration file.