Expected Behaviour:
PiHole working on all devices and blocking on the first try.
Operating system: latest Raspberry Pi OS 64-bit installation (bookworm), done via rpi-imager
. Output of uname -a
: Linux myraspberrypi 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
I'm using a ZTE H6645P V2 modem, and I've set up the Raspi as a static IP (192.168.1.67). I've installed PiHole, setting up the correct interface eth0
(since the Raspi is connected to the modem via the Ethernet cable), then clicked on set static IP using current values
, and I've temporarily selected Comodo. Then ran the following commands: sudo apt install unbound dns-root-data
and copied the configuration file /etc/unbound/unbound.conf.d/pi-hole.conf
from the official PiHole unbound guide. Restarted unbound and rebooted the Raspi, then I went to PiHole Web Settings, disabled Comodo and added 127.0.0.1#5335
.
Then, the PiHole unbound guide tells me to run the following commands:
sudo systemctl disable --now unbound-resolvconf.service; sudo sed -Ei 's/^unbound_conf=/#unbound_conf=/' /etc/resolvconf.conf; sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf; sudo systemctl restart unbound
however the second and third (can't remove a file that doesn't exist) command both fail.
cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.67
nameserver 192.168.1.1
Then I've set the PiHole as the Primary DNS Server (and, when testing, I've set the PiHole as the Secondary DNS Server too, but nothing changed).
I don't know if these errors are causing the issues I'm going to explain in the next paragraph.
Actual Behaviour:
Blocking, both on my Android phones and computer/laptop, sometimes works, sometimes doesn't work completely and sometimes it blocks only after I reload the page 2-3 times. Tried rebooting the modem, Raspi, devices, clearing all browser data and so on and so forth. I tried to use nmcli
and edited my ethernet connection so that I get this output:
cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.67
but it doesn't change anything. I have, for testing purposes, blocked soundcloud.com, and when I execute nslookup on my client computer:
β ~ nslookup soundcloud.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: soundcloud.com
Address: 0.0.0.0
Name: soundcloud.com
Address: ::
Then, five minutes later, executing the same command again yields:
β ~ nslookup soundcloud.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: soundcloud.com
Address: 108.138.199.27
Name: soundcloud.com
Address: 108.138.199.40
Name: soundcloud.com
Address: 108.138.199.109
Name: soundcloud.com
Address: 108.138.199.118
To be honest, I think it's the modem fault because, if I point point both Primary and Secondary DNS Servers in the modem, while rebooting the Raspi the DNS Resolutions work, while, technically it shouldn't work.
I had Raspi in DHCP mode before changing ISP (thus modem too) and all worked flawlessly, when the Raspi was down, everything was down too because everything was passing through the Raspi (and that's what I want). Now, if I enable DHCP in Raspi and disable DHCP in the modem, no devices are able to connect.
This is the page on my modem related to DHCP/DNS Settings (after a modem reset):
Debug Token:
[β] Your debug token is: https://tricorder.pi-hole.net/DNL5u0hx/
Thank you all for your help.