From a16698c547e161bebcce19589be864b490be6a54 Mon Sep 17 00:00:00 2001 From: deHakkelaar Date: Fri, 25 Dec 2020 12:11:48 +0100 Subject: [PATCH] Disable `resolvconf` for `unbound` (optional) The `unbound` package can come with a systemd service called `unbound-resolvconf.service` and default enabled (Pi-OS Buster at least). It 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`. These added instructions allow one to use the DNS servers configured in `dhcpcd.conf` instead of the one pushed by the `unbound-resolvconf` service. --- docs/guides/unbound.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/guides/unbound.md b/docs/guides/unbound.md index dcdd7be..6c31a52 100644 --- a/docs/guides/unbound.md +++ b/docs/guides/unbound.md @@ -160,6 +160,42 @@ 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` for `unbound` (optional) + +The `unbound` package can come with a systemd service called `unbound-resolvconf.service` and default enabled. +It 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. +If you configured `/etc/dhcpcd.conf` with a `static domain_name_servers=` line, these DNS server(s) will be ignored/overruled by this service. + +To check if this service is enabled for your distribution, run below one and take note of the 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: + +```bash +sudo systemctl status unbound-resolvconf.service +``` + +To disable the service if so desire, run below two: + +```bash +sudo systemctl disable unbound-resolvconf.service +``` + +```bash +sudo systemctl stop unbound-resolvconf.service +``` + +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