# Unbound on pi hole causing SERVFAIL

**URL:** https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813
**Category:** Community Help
**Created:** [May 6, 2023, 7:44pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813 "2023-05-06T19:44:44Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![duhipu.ugofin](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@duhipu.ugofin](https://discourse.pi-hole.net/u/duhipu.ugofin)
#### Post date: [May 6, 2023, 7:44pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/1 "2023-05-06T19:44:44Z")

</div>

**The issue I am facing:**  
Getting an SERVFAIL on unbound with pi hole installed  
**Details about my system:**  
raspberry pi 4 (4gb)  
**What I have changed since installing Pi-hole:**  
I've installed Unbound following the official documentation

> **[unbound - Pi-hole documentation](https://docs.pi-hole.net/guides/dns/unbound/)**

When I use the dig command  
dig pi-hole.net 127.0.0.1 -p 5335

I get

```auto
; <<>> DiG 9.16.37-Debian <<>> pi-hole.net @127.0.0.1 -p 5335
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 7704
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

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

;; Query time: 0 msec
;; SERVER: 127.0.0.1#5335(127.0.0.1)
;; WHEN: Sat May 06 12:43:51 PDT 2023
;; MSG SIZE rcvd: 40

```

Oddly enough all domains get forwarded when setup on Pi hole just nothing caches. Also dig reads no error when set to just 127.0.0.1 without the port

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 6, 2023, 8:00pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/2 "2023-05-06T20:00:06Z")

</div>

What is the complete output of the following command from the Pi terminal:

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

---

<div class="post-metadata">

### Author: ![duhipu.ugofin](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@duhipu.ugofin](https://discourse.pi-hole.net/u/duhipu.ugofin)
#### Post date: [May 6, 2023, 8:05pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/3 "2023-05-06T20:05:17Z")

</div>

> [@jfb](#):
>
> `sudo grep -v '#\|^` -R /etc/unbound/unbound.conf\*`

```auto
/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/resolvconf_resolvers.conf:forward-zone:
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:	name: "."
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:	forward-addr: 2600:6c51:4c3f:7159::1
/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

```

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 6, 2023, 8:21pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/4 "2023-05-06T20:21:26Z")

</div>

> [@duhipu.ugofin](#):
>
> ```auto
> /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:forward-zone:
> /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:	name: "."
> /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:	forward-addr: 2600:6c51:4c3f:7159::1
> 
> ```

1. Edit file `/etc/resolvconf.conf` and comment out the last line which should then read:

`#unbound_conf=/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf`

1. Delete the unwanted unbound configuration file:

`sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf`

1. Restart unbound:

`sudo service unbound restart`

---

<div class="post-metadata">

### Author: ![duhipu.ugofin](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@duhipu.ugofin](https://discourse.pi-hole.net/u/duhipu.ugofin)
#### Post date: [May 6, 2023, 8:24pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/5 "2023-05-06T20:24:20Z")

</div>

> [@jfb](#):
>
> sudo rm /etc/unbound/unbound.conf.d/resolvconf\_resolvers.conf

this is the new output of the dig command

```auto
; <<>> DiG 9.16.37-Debian <<>> pi-hole.net @127.0.0.1 -p 5335
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50610
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
pi-hole.net. 295	IN	A	3.18.136.52

;; Query time: 0 msec
;; SERVER: 127.0.0.1#5335(127.0.0.1)
;; WHEN: Sat May 06 13:24:02 PDT 2023
;; MSG SIZE rcvd: 56

```

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 6, 2023, 8:27pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/6 "2023-05-06T20:27:46Z")

</div>

That is the correct reply for that dig command. Problem solved?

---

<div class="post-metadata">

### Author: ![duhipu.ugofin](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@duhipu.ugofin](https://discourse.pi-hole.net/u/duhipu.ugofin)
#### Post date: [May 6, 2023, 8:29pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/7 "2023-05-06T20:29:32Z")

</div>

From the looks of it yes. What was the issue?

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 6, 2023, 8:31pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/8 "2023-05-06T20:31:27Z")

</div>

> [@duhipu.ugofin](#):
>
> What was the issue?

Your OS installed a forwarding configuration, which changed unbound from a recursive resolver (our default setup per our guide) to a forwarding resolver.

Deleting the forwarding configuration and disabling the mechanism that installed that configuration returns unbound to the recursive configuration.

---

<div class="post-metadata">

### Author: ![duhipu.ugofin](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/d/a183cd/32.png) [@duhipu.ugofin](https://discourse.pi-hole.net/u/duhipu.ugofin)
#### Post date: [May 6, 2023, 8:32pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/9 "2023-05-06T20:32:36Z")

</div>

That's weird as I'm using raspberry pi's os 64 bit (fresh install)

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [May 6, 2023, 8:34pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/10 "2023-05-06T20:34:46Z")

</div>

That may not be as weird as you think. This is a problem with the Bullseye version of Debian/Raspbian.

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [May 27, 2023, 8:35pm UTC](https://discourse.pi-hole.net/t/unbound-on-pi-hole-causing-servfail/62813/11 "2023-05-27T20:35:36Z")

</div>

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