Set-up issues with Pi-hole/Unbound

Hi guys

I have been trying to set up Pi-hole and Unbound for about a week now and I'm currently on my second install (wiped the SD after the first try didn't work and now it seems worse than before :P). I'm currently back to using 1.1.1.1 as a manual DNS on my devices so I can write this post at all.

Expected Behaviour:

I used this guide to install Pi-hole on a Raspberry Pie 4 and this subsection to set-up unbound. I am now at the end of the installation process and I'm trying these three tests:

dig pi-hole.net @127.0.0.1 -p 5335
dig fail01.dnssec.works @127.0.0.1 -p 5335
dig dnssec.works @127.0.0.1 -p 5335

Actual Behaviour:

SERVFAIL. For all of them.

Debug Token:

I cannot upload the log as I receive an error uploading it, so it suggests contacting the Pi-hole team.

Let me know what other info I can provide, I really appreciate the help!

DNSSEC needs an accurate clock. Check that your clock is accurate and the timezone is correct. The command below will let you confirm. This page has more info on how to set your time zone and enable NTP (to automatically keep it accurate) if needed.

timedatectl

I've had very mixed results using the dnssec.works domains recently, but the pi-hole.net one should work and return the IP of their site rather than fail.

1 Like

When I do

timedatectl

I receive

 Local time: Sat 2023-12-23 21:40:53 CET
           Universal time: Sat 2023-12-23 20:40:53 UTC
                 RTC time: n/a
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

and I'm based in Germany, so that should be alright I guess?

Also here are the current status for Pi-hole

  [✓] FTL is listening on port 53
     [✓] UDP (IPv4)
     [✓] TCP (IPv4)
     [✓] UDP (IPv6)
     [✓] TCP (IPv6)

  [✓] Pi-hole blocking is enabled

and Unbound

● unbound.service - Unbound DNS server
     Loaded: loaded (/lib/systemd/system/unbound.service; enabled; preset: enabled)
     Active: active (running) since Sat 2023-12-23 21:39:40 CET; 6min ago
       Docs: man:unbound(8)
    Process: 1559 ExecStartPre=/usr/libexec/unbound-helper chroot_setup (code=exited, status=0/SUCCESS)
    Process: 1561 ExecStartPre=/usr/libexec/unbound-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
   Main PID: 1563 (unbound)
      Tasks: 1 (limit: 3919)
        CPU: 331ms
     CGroup: /system.slice/unbound.service
             └─1563 /usr/sbin/unbound -d -p

Dec 23 21:39:40 raspberrypi systemd[1]: Starting unbound.service - Unbound DNS server...
Dec 23 21:39:40 raspberrypi unbound[1563]: [1563:0] warning: subnetcache: prefetch is set but not working for data originating from >
Dec 23 21:39:40 raspberrypi unbound[1563]: [1563:0] info: start of service (unbound 1.17.1).
Dec 23 21:39:40 raspberrypi systemd[1]: Started unbound.service - Unbound DNS server.
lines 1-16/16 (END)

Yes that looks okay, it's a common cause of Unbound problems so worth the check.

Does this command return a result (note it uses delv not dig)?

delv dnssec.works @127.0.0.1 -p 5335

unfortunately not :frowning:

;; resolution failed: SERVFAIL

OK so I don't know why, but I was able to replace 1.1.1.1 with the IP of my Pi just now and I'm able to resolve adresses on my computer again (although manually in WiFi settings, on the previous install it worked without that). Then I tried

dig fail01.dnssec.works

and

dig dnssec.works

on a client (the computer) for a change and here I received SERVAIL and NOERROR respectively. So while I'm happy my Internet works again I'd still like to figure out why it works on the client side and not on the Pi itself (where I still receive SERVAIL for both (ammended) commands.

What is the output of this command? It will show all the related Unbound config in use.

sudo grep -v '#\|^$' -R /etc/unbound/unbound.conf*

Would you mind also trying the following please? Set your Pi-hole DNS back to just Unbound on 127.0.0.1#5335 (you can put it back to just 1.1.1.1 afterwards). Then run the above command again but without the port option:

delv dnssec.works @127.0.0.1

Presumably that still fails, since now you are asking Pi-hole and Pi-hole is asking Unbound. However now the Pi-hole Query Log will show the request. Do you see BOGUS, Retried, or anything else of interest related to that dnssec.works domain?

/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:    verbosity: 0
/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
/etc/unbound/unbound.conf.d/remote-control.conf:remote-control:
/etc/unbound/unbound.conf.d/remote-control.conf:  control-enable: yes
/etc/unbound/unbound.conf.d/remote-control.conf:  control-interface: /run/unbound.ctl
/etc/unbound/unbound.conf.d/datei2:server:
/etc/unbound/unbound.conf.d/datei2:   interface: 0.0.0.0
/etc/unbound/unbound.conf.d/datei2:   access-control: 127.0.0.0/8 allow
/etc/unbound/unbound.conf.d/datei2:   access-control: 192.168.0.0/16 allow

Do you mean changing the Pi-hole DNS in /etc/dhcpcd .conf? This file currently contains

static domain_name_servers=1.1.1.1 1.0.0.1
interface eth0
        static ip_address=MYPIIP/24
        static routers=MYROUTERIP
        static domain_name_servers=

So if I change it to

static domain_name_servers=127.0.0.1#5335
interface eth0
        static ip_address=MYPIIP/24
        static routers=MYROUTERIP
        static domain_name_servers=

and run

delv dnssec.works @127.0.0.1

I get

; fully validated
dnssec.works.		2508	IN	A	5.45.107.88
dnssec.works.		2508	IN	RRSIG	A 8 2 3600 20240102122202 20231203114428 63306 dnssec.works. VZ3/NBb3R2VeTp+GtjpazB+FWui4IFyFaQrwboCBCxZ6iaXy7IKrwPiw ujma6y43x38ZLYSr3+ioRXIjrlSOqRooqEtT22YW6zj1wGtaK2AeuL0Y 5q7eFdpX0xkNW2V04e0VEOxSPt2uh3dG0F1MXVmqComF+v5K1yV8EbnX z+gjj9wds0EDbGV+0+ZOb2VGede3OtdjKSK4w/81m60J64/Fu5mybH7i ub9QnD6NMRvAh9t58w4y5Sx/+ghKeY04

and from the logs:

No, I meant in Pi-hole's Settings > DNS page, which is what I assumed you were referring to in the opening post when you mentioned changing them from Unbound to 1.1.1.1 as a workaround.

OK. Did that (the file dhcpcd .conf still has my changes above though) and my Internet went dark.

Only when I changed it to a public DNS did it work again.

delv dnssec.works @127.0.0.1

atill lead to

;; resolution failed: SERVFAIL

unfortunately :frowning:

The purpose of that test is to review the Query Log.

Presumably that still fails, since now you are asking Pi-hole and Pi-hole is asking Unbound. However now the Pi-hole Query Log will show the request. Do you see BOGUS , Retried , or anything else of interest related to that dnssec.works domain?

Btw since I have Internet again (with the public DNS) I pulled a log and uploaded it here https://tricorder.pi-hole.net/o2Qu9aIM/ :slight_smile:

Oh right sorry! I changed it back, executed and took a screenshot:

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