I recently installed Pi-hole on a Raspberry PI 3 Model B.
Everything is working as expected and I decided to start using unbound. I followed the instructions from the official guides.
Unfortunately, I haven't been able to make unbound work as expected and every time I use the dig
command I get a status: SERVFAIL
I have been reading a bunch of threads within the discourse to make sure I'm able to fix it on my own, but I haven't being able to do so
Here are some of the post I have read:
Here are some of the typical output requested to helping debugging unbound issues run on my machine:
unbound-checkconf
unbound-checkconf: no errors in /etc/unbound/unbound.conf
sudo grep -v '#\|^$' -R /etc/unbound/unbound.conf*
/etc/unbound/unbound.conf:include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf:server:
/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf: auto-trust-anchor-file: "/var/lib/unbound/root.key"
/etc/unbound/unbound.conf.d/pi-hole.conf:server:
/etc/unbound/unbound.conf.d/pi-hole.conf:logfile: "/var/log/unbound/unbound.log"
/etc/unbound/unbound.conf.d/pi-hole.conf:log-time-ascii: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:verbosity: 5
/etc/unbound/unbound.conf.d/pi-hole.conf:interface: 127.0.0.1
/etc/unbound/unbound.conf.d/pi-hole.conf:port: 5335
/etc/unbound/unbound.conf.d/pi-hole.conf:do-ip4: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:do-udp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:do-tcp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:do-ip6: no
/etc/unbound/unbound.conf.d/pi-hole.conf:prefer-ip6: no
/etc/unbound/unbound.conf.d/pi-hole.conf:harden-glue: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:harden-dnssec-stripped: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:use-caps-for-id: no
/etc/unbound/unbound.conf.d/pi-hole.conf:edns-buffer-size: 1232
/etc/unbound/unbound.conf.d/pi-hole.conf:prefetch: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:num-threads: 1
/etc/unbound/unbound.conf.d/pi-hole.conf:so-rcvbuf: 1m
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: 192.168.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: 169.254.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: 172.16.0.0/12
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: 10.0.0.0/8
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: fd00::/8
/etc/unbound/unbound.conf.d/pi-hole.conf:private-address: fe80::/10
cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1
I manually updated /etc/resolv.conf
to not use my home router IP
I found something a bit strange when running dig
and checking the unbound logs. When running dig crosstalksolutions.com @127.0.0.1 -p 5335
I get:
; <<>> DiG 9.16.44-Debian <<>> crosstalksolutions.com @127.0.0.1 -p 5335
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 21678
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;crosstalksolutions.com. IN A
;; Query time: 55 msec
;; SERVER: 127.0.0.1#5335(127.0.0.1)
;; WHEN: Tue Dec 26 19:34:08 CET 2023
;; MSG SIZE rcvd: 51
But from the inbounds logs, I can see that there are valid answers:
Dec 26 19:34:08 unbound[16607:0] info: incoming scrubbed packet: ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
crosstalksolutions.com. IN A
;; ANSWER SECTION:
crosstalksolutions.com. 12 IN A 34.120.190.48
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; MSG SIZE rcvd: 56
Dec 26 19:34:08 unbound[16607:0] debug: iter_handle processing q with state QUERY RESPONSE STATE
To avoid having too much noise, I will attach the full log output to as part of this post
unbound logs.txt (44.4 KB)
Running dig
without using unbound
dig crosstalksolutions.com
; <<>> DiG 9.16.44-Debian <<>> crosstalksolutions.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39629
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;crosstalksolutions.com. IN A
;; ANSWER SECTION:
crosstalksolutions.com. 19 IN A 35.190.31.54
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Dec 26 19:51:48 CET 2023
;; MSG SIZE rcvd: 67
Lastly, running nslookup
in the host machine
nslookup crosstalksolutions.com
Server: 192.168.0.31
Address: 192.168.0.31#53
Non-authoritative answer:
Name: crosstalksolutions.com
Address: 35.190.31.54
I'm not sure what else to do. Any help with this issue would be gladly appreciated.
Thanks