From 9a111803019331937a9e5d58ad91d5265d08e911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 24 Feb 2023 15:01:48 +0100 Subject: [PATCH 1/2] Tweak unbound instruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: deHakkelaar Signed-off-by: Christian König --- docs/guides/dns/unbound.md | 40 +++++++------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/docs/guides/dns/unbound.md b/docs/guides/dns/unbound.md index 46c2753..b57ca36 100644 --- a/docs/guides/dns/unbound.md +++ b/docs/guides/dns/unbound.md @@ -185,36 +185,24 @@ Finally, configure Pi-hole to use your recursive DNS server by specifying `127.0 ### Disable `resolvconf.conf` entry for `unbound` (Required for Debian Bullsye+ releases) -Recent Debian-based OS releases auto-install a package called [`openresolv`](https://wiki.archlinux.org/title/Openresolv), which will cause unexpected behaviour for pihole and unbound. Openresolv's service/config instructs `resolvconf` to write `unbound`'s own DNS service at `nameserver 127.0.0.1` , but without the 5335 port, into the file `/etc/resolv.conf`. That `/etc/resolv.conf` file is used by local services/processes to determine DNS servers configured. You need to remove openresolv, or edit the configuration file and disable the service to work-around the misconfiguration. +Debian Bullsye+ releases auto-install a package called [`openresolv`](https://wiki.archlinux.org/title/Openresolv) with a certain configuration that will cause unexpected behaviour for pihole and unbound. The effect is that the `unbound-resolvconf.service` instructs `resolvconf` to write `unbound`'s own DNS service at `nameserver 127.0.0.1` , but without the 5335 port, into the file `/etc/resolv.conf`. That `/etc/resolv.conf` file is used by local services/processes to determine DNS servers configured. You need to edit the configuration file and disable the service to work-around the misconfiguration. -#### Option 1 - Remove openresolv +#### Step 1 - Disable the Service -If you are sure you don't need the features of openresolv, then removal of the package is the simplest option. +To check if this service is enabled for your distribution, run below one. It will show either `active` or `inactive` or it might not even be installed resulting in a `could not be found` message: ```bash -sudo apt purge openresolv +systemctl is-active unbound-resolvconf.service ``` -#### Option 2 - Step 1 - Disable the Service - -openresolv has a systemd service called `unbound-resolvconf.service.` -To check if this service is enabled for your distribution, run below one and take note of the `Active` line. -It will show either `active` or `inactive` or it might not even be installed resulting in a `could not be found` message: +To disable the service, run the two statements below: ```bash -sudo systemctl status unbound-resolvconf.service -``` - -To disable the service if so desire, run the two statements below: - -```bash -sudo systemctl disable unbound-resolvconf.service -sudo systemctl stop unbound-resolvconf.service - +sudo systemctl disable --now unbound-resolvconf.service ``` -#### Option 2 - Step 2 - Disable the file resolvconf_resolvers.conf +#### Step 2 - Disable the file resolvconf_resolvers.conf Disable the file resolvconf_resolvers.conf from being generated when resolvconf is invoked elsewhere. @@ -223,20 +211,6 @@ sudo sed -Ei 's/^unbound_conf=/#unbound_conf=/' /etc/resolvconf.conf sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf ``` -### Alternative Solution - Step 1 - -To have the `domain_name_servers=` in the file `/etc/dhcpcd.conf` activated/propagate, run below one: - -```bash -sudo systemctl restart dhcpcd -``` - -And check with below one if IP(s) on the `nameserver` line(s) reflects the ones in the `/etc/dhcpcd.conf` file: - -```bash -cat /etc/resolv.conf -``` - ### Add logging to unbound !!! warning From c267bf7c24173d6568a9d2212eb4cd202f0ff9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Fri, 24 Feb 2023 20:46:21 +0100 Subject: [PATCH 2/2] Address reviewer's comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- docs/guides/dns/unbound.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/dns/unbound.md b/docs/guides/dns/unbound.md index b57ca36..f891061 100644 --- a/docs/guides/dns/unbound.md +++ b/docs/guides/dns/unbound.md @@ -183,9 +183,9 @@ Finally, configure Pi-hole to use your recursive DNS server by specifying `127.0 (don't forget to hit Return or click on `Save`) -### Disable `resolvconf.conf` entry for `unbound` (Required for Debian Bullsye+ releases) +### Disable `resolvconf.conf` entry for `unbound` (Required for Debian Bullseye+ releases) -Debian Bullsye+ releases auto-install a package called [`openresolv`](https://wiki.archlinux.org/title/Openresolv) with a certain configuration that will cause unexpected behaviour for pihole and unbound. The effect is that the `unbound-resolvconf.service` instructs `resolvconf` to write `unbound`'s own DNS service at `nameserver 127.0.0.1` , but without the 5335 port, into the file `/etc/resolv.conf`. That `/etc/resolv.conf` file is used by local services/processes to determine DNS servers configured. You need to edit the configuration file and disable the service to work-around the misconfiguration. +Debian Bullseye+ releases auto-install a package called [`openresolv`](https://wiki.archlinux.org/title/Openresolv) with a certain configuration that will cause unexpected behaviour for pihole and unbound. The effect is that the `unbound-resolvconf.service` instructs `resolvconf` to write `unbound`'s own DNS service at `nameserver 127.0.0.1` , but without the 5335 port, into the file `/etc/resolv.conf`. That `/etc/resolv.conf` file is used by local services/processes to determine DNS servers configured. You need to edit the configuration file and disable the service to work-around the misconfiguration. #### Step 1 - Disable the Service @@ -195,7 +195,7 @@ To check if this service is enabled for your distribution, run below one. It wil systemctl is-active unbound-resolvconf.service ``` -To disable the service, run the two statements below: +To disable the service, run the statement below: ```bash sudo systemctl disable --now unbound-resolvconf.service