Hi All
i have lost a few hairs trying to get unbound working. I installed unbound as per instructions here
Expected Behaviour:
I installed Pi-hole on the following.
Raspberry Pi 2
OS- Raspibian bookworm.
Pi-hole works flawlessly.
I then installed unbound and have not managed to get unbound to work.
Actual Behaviour:
Pihole works. no issues observed.
Unbound gives communications error.
Debug Token:
##below is the the error
root@piHole:~# dig pi-hole.net @127.0.0.1 -p 5335
;; communications error to 127.0.0.1#5335: timed out
;; communications error to 127.0.0.1#5335: timed out
;; communications error to 127.0.0.1#5335: timed out
I looked at your grep of the config files in /etc/unbound/unbound.conf.d/ and notice one thing missing that is in mine and that is lines for remote-control.conf. Does this file exist in that directory ( should be pi-hole.conf, remote-control.conf, root-auto-trust-anchor-file.conf )
Note that this file exists on a fresh install on Unbound.
Updated: added the contents of the file:
remote-control:
control-enable: yes
# by default the control interface is is 127.0.0.1 and ::1 and port 8953
# it is possible to use a unix socket too
control-interface: /run/unbound.ctl
root@piHole:~# ls -l /etc/unbound/unbound.conf.d/
total 12
-rw-r--r-- 1 root root 650 Dec 30 19:56 pi-hole.conf
-rw-r--r-- 1 root root 195 Feb 13 2024 remote-control.conf
-rw-r--r-- 1 root root 190 Feb 13 2024 root-auto-trust-anchor-file.conf
root@piHole:~# ls -l /etc/unbound/unbound.conf.d/remote-control.conf
-rw-r--r-- 1 root root 195 Feb 13 2024 /etc/unbound/unbound.conf.d/remote-control.conf
root@piHole:~# cat /etc/unbound/unbound.conf.d/remote-control.conf
remote-control:
control-enable: yes
# by default the control interface is is 127.0.0.1 and ::1 and port 8953
# it is possible to use a unix socket too
control-interface: /run/unbound.ctl
Yeah. Your log section looks different than mine. That might mean nothing. Curious what the output of journalctl --boot 0 --unit unbound.service is. This will look system logs for just today.
for a moment a i thought there is something to go after but seems i cant pick anything.
Dec 30 19:36:56 piHole systemd[1]: Starting unbound.service - Unbound DNS server...
Dec 30 19:36:57 piHole unbound[3087]: [3087:0] warning: subnetcache: prefetch is set but not working for data originating from the subnet module cache.
Dec 30 19:36:57 piHole systemd[1]: Started unbound.service - Unbound DNS server.
Dec 30 19:36:57 piHole unbound[3087]: [3087:0] info: start of service (unbound 1.17.1).
Dec 30 19:42:50 piHole unbound[3087]: [3087:0] info: service stopped (unbound 1.17.1).
Dec 30 19:42:50 piHole systemd[1]: Stopping unbound.service - Unbound DNS server...
Dec 30 19:42:51 piHole systemd[1]: unbound.service: Deactivated successfully.
Dec 30 19:42:51 piHole systemd[1]: Stopped unbound.service - Unbound DNS server.
Dec 30 19:42:51 piHole systemd[1]: unbound.service: Consumed 1.655s CPU time.
Dec 30 19:42:51 piHole systemd[1]: Starting unbound.service - Unbound DNS server...
Dec 30 19:42:52 piHole systemd[1]: Started unbound.service - Unbound DNS server.
Dec 30 19:56:02 piHole systemd[1]: Stopping unbound.service - Unbound DNS server...
Dec 30 19:56:02 piHole systemd[1]: unbound.service: Deactivated successfully.
Dec 30 19:56:02 piHole systemd[1]: Stopped unbound.service - Unbound DNS server.
Dec 30 19:56:02 piHole systemd[1]: unbound.service: Consumed 1.498s CPU time.
Dec 30 19:56:03 piHole systemd[1]: Starting unbound.service - Unbound DNS server...
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: increased limit(open files) from 1024 to 4140
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: creating udp4 socket 0.0.0.0 535
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: creating tcp4 socket 0.0.0.0 535
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: creating unix socket /run/unbound.ctl
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: chdir to /etc/unbound
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: drop user privileges, run as unbound
Dec 30 19:56:03 piHole unbound[4350]: Dec 30 19:56:03 unbound[4350:0] debug: switching log to /var/log/unbound/unbound.log
Dec 30 19:56:04 piHole systemd[1]: Started unbound.service - Unbound DNS server.
Dec 30 19:56:37 piHole systemd[1]: Stopping unbound.service - Unbound DNS server...
Dec 30 19:56:38 piHole systemd[1]: unbound.service: Deactivated successfully.
Dec 30 19:56:38 piHole systemd[1]: Stopped unbound.service - Unbound DNS server.
Dec 30 19:56:38 piHole systemd[1]: unbound.service: Consumed 2.013s CPU time.
Dec 30 19:56:38 piHole systemd[1]: Starting unbound.service - Unbound DNS server...
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: increased limit(open files) from 1024 to 4140
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: creating udp4 socket 0.0.0.0 5335
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: creating tcp4 socket 0.0.0.0 5335
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: creating unix socket /run/unbound.ctl
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: chdir to /etc/unbound
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: drop user privileges, run as unbound
Dec 30 19:56:38 piHole unbound[4463]: Dec 30 19:56:38 unbound[4463:0] debug: switching log to /var/log/unbound/unbound.log
Dec 30 19:56:39 piHole systemd[1]: Started unbound.service - Unbound DNS server.
Except, this is a problem only for Unbound. This is why i posted the entries showing dns resolution success earlier. If it was that drops then I would expect some packets to make it through or at least get occassional success. But this just does not work with unbound.
Fair enough. Unbound is performing the look ups recursively so its has more room for potential failures.
I'm afraid I'm running out of ideas to check. I did see a comment @deHakkelaar posted on a similar issue. He mentioned running nslookup -class=chaos -type=txt version.bind 127.0.0.1 to ensure pihole was getting queried. I imagine that it is as it seems to work but just not to local host which I'm scratching my head on.
thanks iam out of my depth now. here is the output. I changed my dns server on windows.
Please note the windows nslookup seems unreliable. M$ appears to have changed without notice. Server and port appears to be overridden by whatever is defined on the NIC. The result therefore comes from my router.