Pihole + Unbound - not caching DNS [SOLVED] TY Dan & JFB!

ok, here is the result...
I'm beginning to wonder (and TY Dan for ALL the help thus far!) if perhaps I may have presented my issue correctly - the ultimate goal is to make sure I've set this up correctly, so that unbound is running as a recursive DNS...

I will apologize, if I'm making you tear out your hair with this... :slight_smile:

this does look a LOT better though...

That set of status and replies appears completely normal, given that screen alone. If these are all first queries, you would expect them to not be served from cache.

Run these commands in the order and timing given, and post the results:

sudo service unbound restart

pihole restartdns

dig pi-hole.net @192.168.1.158

wait 5 seconds

dig pi-hole.net @192.168.1.158

grep pi-hole.net /var/log/pihole.log | tail -n20

If the first dig command produces a reply, then unbound is working properly, since the domain should not be in the Pi-hole cache or the unbound cache after the restarts.

The second dig should be served from cache, since the domain TTL is greater than 5 seconds.

The log output will show the two subsequent digs for the domain.

ok, here goes all....

berrypi:~$ sudo service unbound restart
pi@raspberrypi:~$ pihole restartdns
  [✓] Restarting DNS server
pi@raspberrypi:~$ dig pi-hole.net @192.168.1.158

; <<>> DiG 9.11.5-P4-5.1+deb10u5-Raspbian <<>> pi-hole.net @192.168.1.158
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31902
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1472
;; QUESTION SECTION:
;pi-hole.net.			IN	A

;; ANSWER SECTION:
pi-hole.net.		900	IN	A	178.128.134.214

;; Query time: 141 msec
;; SERVER: 192.168.1.158#53(192.168.1.158)
;; WHEN: Fri Jul 23 21:45:07 EDT 2021
;; MSG SIZE  rcvd: 56
pi@raspberrypi:~$ dig pi-hole.net @192.168.1.158

; <<>> DiG 9.11.5-P4-5.1+deb10u5-Raspbian <<>> pi-hole.net @192.168.1.158
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11164
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pi-hole.net.			IN	A

;; ANSWER SECTION:
pi-hole.net.		879	IN	A	178.128.134.214

;; Query time: 1 msec
;; SERVER: 192.168.1.158#53(192.168.1.158)
;; WHEN: Fri Jul 23 21:45:28 EDT 2021
;; MSG SIZE  rcvd: 56
pi@raspberrypi:~$ grep pi-hole.net /var/log/pihole.log | tail -n20
Jul 23 21:02:22 dnsmasq[6566]: query[A] pi-hole.net from 127.0.0.1
Jul 23 21:02:22 dnsmasq[6566]: cached pi-hole.net is 178.128.134.214
Jul 23 21:02:23 dnsmasq[6566]: query[A] pi-hole.net from 127.0.0.1
Jul 23 21:02:23 dnsmasq[6566]: cached pi-hole.net is 178.128.134.214
Jul 23 21:02:24 dnsmasq[6566]: query[A] pi-hole.net from 127.0.0.1
Jul 23 21:02:24 dnsmasq[6566]: cached pi-hole.net is 178.128.134.214
Jul 23 21:09:30 dnsmasq[6566]: query[A] discourse.pi-hole.net from 192.168.1.1
Jul 23 21:09:30 dnsmasq[6566]: forwarded discourse.pi-hole.net to 127.0.0.1
Jul 23 21:09:30 dnsmasq[6566]: query[AAAA] discourse.pi-hole.net from 192.168.1.1
Jul 23 21:09:30 dnsmasq[6566]: forwarded discourse.pi-hole.net to 127.0.0.1
Jul 23 21:09:30 dnsmasq[6566]: reply discourse.pi-hole.net is 159.203.95.226
Jul 23 21:09:30 dnsmasq[6566]: reply discourse.pi-hole.net is 2604:a880:800:a1::565:a001
Jul 23 21:44:10 dnsmasq[6566]: query[A] b2discourse.pi-hole.net from 192.168.1.1
Jul 23 21:44:10 dnsmasq[6566]: forwarded b2discourse.pi-hole.net to 127.0.0.1
Jul 23 21:44:10 dnsmasq[6566]: reply b2discourse.pi-hole.net is <CNAME>
Jul 23 21:45:07 dnsmasq[4891]: query[A] pi-hole.net from 192.168.1.158
Jul 23 21:45:07 dnsmasq[4891]: forwarded pi-hole.net to 127.0.0.1
Jul 23 21:45:07 dnsmasq[4891]: reply pi-hole.net is 178.128.134.214
Jul 23 21:45:28 dnsmasq[4891]: query[A] pi-hole.net from 192.168.1.158
Jul 23 21:45:28 dnsmasq[4891]: cached pi-hole.net is 178.128.134.214

All completely normal and both unbound and Pi-hole are working as expected.

1 Like

ok, kewl!
thank you BOTH for the reassurances!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.