So I'm struggling with the setup of unbound. I followed the guide. I have installed Pi-hole first, then unbound. I've added the /etc/unbound/unbound.conf.d/pi-hole.conf as shown in the guide.
But when I try to start it as stated in the guide, I get this:
sudo systemctl restart unbound
Job for unbound.service failed because the control process exited with error code.
See "systemctl status unbound.service" and "journalctl -xeu unbound.service" for details.
I think it's a problem with port 53 for some reason. I rebooted the system and unbound started before pihole and pihole couldn't start because of port 53. Had to do systemctl stop unbound . Now pihole is running again but unbound is not.
Nov 14 10:14:13 johnny-K53BY systemd[1]: Starting unbound.service - Unbound DNS server...
āā Subject: A start job for unit unbound.service has begun execution
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has begun execution.
āā
āā The job identifier is 19449.
Nov 14 10:14:14 johnny-K53BY (unbound)[17146]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Nov 14 10:14:14 johnny-K53BY unbound[17146]: [1731575654] unbound[17146:0] error: can't bind socket: Address already in use for :: port 53
Nov 14 10:14:14 johnny-K53BY unbound[17146]: [1731575654] unbound[17146:0] fatal error: could not open ports
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
āā Subject: Unit process exited
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā An ExecStart= process belonging to unit unbound.service has exited.
āā
āā The process' exit code is 'exited' and its exit status is 1.
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:14 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 19449 and the job result is failed.
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Scheduled restart job, restart counter is at 1.
āā Subject: Automatic restarting of a unit has been scheduled
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā Automatic restarting of the unit unbound.service has been scheduled, as the result for
āā the configured Restart= setting for the unit.
Nov 14 10:14:14 johnny-K53BY systemd[1]: Starting unbound.service - Unbound DNS server...
āā Subject: A start job for unit unbound.service has begun execution
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has begun execution.
āā
āā The job identifier is 19632.
Nov 14 10:14:14 johnny-K53BY (unbound)[17178]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Nov 14 10:14:14 johnny-K53BY unbound[17178]: [1731575654] unbound[17178:0] error: can't bind socket: Address already in use for :: port 53
Nov 14 10:14:14 johnny-K53BY unbound[17178]: [1731575654] unbound[17178:0] fatal error: could not open ports
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
āā Subject: Unit process exited
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā An ExecStart= process belonging to unit unbound.service has exited.
āā
āā The process' exit code is 'exited' and its exit status is 1.
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:14 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 19632 and the job result is failed.
Nov 14 10:14:14 johnny-K53BY systemd[1]: unbound.service: Scheduled restart job, restart counter is at 2.
āā Subject: Automatic restarting of a unit has been scheduled
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā Automatic restarting of the unit unbound.service has been scheduled, as the result for
āā the configured Restart= setting for the unit.
Nov 14 10:14:14 johnny-K53BY systemd[1]: Starting unbound.service - Unbound DNS server...
āā Subject: A start job for unit unbound.service has begun execution
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has begun execution.
āā
āā The job identifier is 19816.
Nov 14 10:14:15 johnny-K53BY (unbound)[17202]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Nov 14 10:14:15 johnny-K53BY unbound[17202]: [1731575655] unbound[17202:0] error: can't bind socket: Address already in use for :: port 53
Nov 14 10:14:15 johnny-K53BY unbound[17202]: [1731575655] unbound[17202:0] fatal error: could not open ports
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
āā Subject: Unit process exited
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā An ExecStart= process belonging to unit unbound.service has exited.
āā
āā The process' exit code is 'exited' and its exit status is 1.
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:15 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 19816 and the job result is failed.
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Scheduled restart job, restart counter is at 3.
āā Subject: Automatic restarting of a unit has been scheduled
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā Automatic restarting of the unit unbound.service has been scheduled, as the result for
āā the configured Restart= setting for the unit.
Nov 14 10:14:15 johnny-K53BY systemd[1]: Starting unbound.service - Unbound DNS server...
āā Subject: A start job for unit unbound.service has begun execution
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has begun execution.
āā
āā The job identifier is 20000.
Nov 14 10:14:15 johnny-K53BY (unbound)[17227]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Nov 14 10:14:15 johnny-K53BY unbound[17227]: [1731575655] unbound[17227:0] error: can't bind socket: Address already in use for :: port 53
Nov 14 10:14:15 johnny-K53BY unbound[17227]: [1731575655] unbound[17227:0] fatal error: could not open ports
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
āā Subject: Unit process exited
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā An ExecStart= process belonging to unit unbound.service has exited.
āā
āā The process' exit code is 'exited' and its exit status is 1.
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:15 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 20000 and the job result is failed.
Nov 14 10:14:15 johnny-K53BY systemd[1]: unbound.service: Scheduled restart job, restart counter is at 4.
āā Subject: Automatic restarting of a unit has been scheduled
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā Automatic restarting of the unit unbound.service has been scheduled, as the result for
āā the configured Restart= setting for the unit.
Nov 14 10:14:15 johnny-K53BY systemd[1]: Starting unbound.service - Unbound DNS server...
āā Subject: A start job for unit unbound.service has begun execution
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has begun execution.
āā
āā The job identifier is 20184.
Nov 14 10:14:16 johnny-K53BY (unbound)[17253]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Nov 14 10:14:16 johnny-K53BY unbound[17253]: [1731575656] unbound[17253:0] error: can't bind socket: Address already in use for :: port 53
Nov 14 10:14:16 johnny-K53BY unbound[17253]: [1731575656] unbound[17253:0] fatal error: could not open ports
Nov 14 10:14:16 johnny-K53BY systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
āā Subject: Unit process exited
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā An ExecStart= process belonging to unit unbound.service has exited.
āā
āā The process' exit code is 'exited' and its exit status is 1.
Nov 14 10:14:16 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:16 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 20184 and the job result is failed.
Nov 14 10:14:16 johnny-K53BY systemd[1]: unbound.service: Scheduled restart job, restart counter is at 5.
āā Subject: Automatic restarting of a unit has been scheduled
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā Automatic restarting of the unit unbound.service has been scheduled, as the result for
āā the configured Restart= setting for the unit.
Nov 14 10:14:16 johnny-K53BY systemd[1]: unbound.service: Start request repeated too quickly.
Nov 14 10:14:16 johnny-K53BY systemd[1]: unbound.service: Failed with result 'exit-code'.
āā Subject: Unit failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā The unit unbound.service has entered the 'failed' state with result 'exit-code'.
Nov 14 10:14:16 johnny-K53BY systemd[1]: Failed to start unbound.service - Unbound DNS server.
āā Subject: A start job for unit unbound.service has failed
āā Defined-By: systemd
āā Support: http://www.ubuntu.com/support
āā
āā A start job for unit unbound.service has finished with a failure.
āā
āā The job identifier is 20368 and the job result is failed.
server:
# can be uncommented if you do not need user privilege protection
# username: ""
# can be uncommented if you do not need file access protection
# chroot: ""
# location of the trust anchor file that enables DNSSEC. note that
# the location of this file can be elsewhere
auto-trust-anchor-file: "/usr/local/etc/unbound/root.key"
# auto-trust-anchor-file: "/var/lib/unbound/root.key"
# send minimal amount of information to upstream servers to enhance privacy
qname-minimisation: yes
# specify the interface to answer queries from by ip-address.
interface: 0.0.0.0
# interface: ::0
# addresses from the IP range that are allowed to connect to the resolver
access-control: 192.168.0.0/16 allow
# access-control: 2001:DB8/64 allow
# The following line includes additional configuration files from the
# /etc/unbound/unbound.conf.d directory.
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
After restarting the unbound service, this should include the files in the /etc/unbound/unbound.conf.d/ directory, and thus apply the settings from your pi-hole.conf.
I'm not ready to add that on the base of just one report.
What's more, from the looks of it, your unbound.conf seems to have been manually edited, and if so, it would of course be deviating from the package installation defaults.
Adding some arbitrary access-control ranges is unlikely to happen automatically, as IP ranges would be specific to a network. Furthermore, the ranges are inconsistent for IPv4 and IPv6: One is allowing a private IPv4 range, the other tries to allow a public IPv6 one, and that line contains an entirely invalid IPv6 address, which would have prevented parsing if activated.
It would be very unlikely for a package installation script to pick a set of such incoherent values.
$ cat etc/unbound/unbound.conf
# Unbound configuration file for Debian.
#
# See the unbound.conf(5) man page.
#
# See /usr/share/doc/unbound/examples/unbound.conf for a commented
# reference config file.
#
# The following line includes additional configuration files from the
# /etc/unbound/unbound.conf.d directory.
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"