Unbound can't start at boot, and delays boot process

Ubuntu Version:
Ubuntu server 6.17.0-14-generic #14-Ubuntu

(fresh install)

Problem Description:
I installed, configured and enabled unbound. When booting, it blocks and delays the process (notably the final systemd-networkd-wait-online.service target).

After the boot is finished and I can finally log in via ssh, I can start unbound with systemctl as if everything is fine.

Screenshots or Error Messages:
stephane@jabberwocky:/home/stephane sudo journalctl -p 3 -xb
[sudo: authenticate] Password:
Feb 13 11:54:40 jabberwocky blkmapd[967]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory
Feb 13 11:54:41 jabberwocky 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 174 and the job result is failed.
Feb 13 11:54:41 jabberwocky resolvconf[1124]: No DNS servers specified, refusing operation.
Feb 13 11:54:41 jabberwocky 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 570 and the job result is failed.

…

Feb 13 11:56:38 jabberwocky systemd-networkd-wait-online[509]: Timeout occurred while waiting for network connectivity.
Feb 13 11:56:38 jabberwocky systemd[1]: Failed to start systemd-networkd-wait-online.service - Wait for Network to be Configured.
β–‘β–‘ Subject: A start job for unit systemd-networkd-wait-online.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: ``http://www.ubuntu.com/support``
β–‘β–‘
β–‘β–‘ A start job for unit systemd-networkd-wait-online.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 83 and the job result is failed.
Feb 13 11:56:40 jabberwocky kodi.bin[1390]: pw.conf: can't load config client.conf: No such file or directory
Feb 13 12:19:52 jabberwocky resolvconf[1599]: No DNS servers specified, refusing operation.

Feb 12 14:16:34 jabberwocky systemd[1]: Starting unbound.service - Unbound DNS server...
Feb 12 14:16:34 jabberwocky (unbound)[1084]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Feb 12 14:16:34 jabberwocky unbound[1084]: [1770905794] unbound[1084:0] error: node eno1:53 getaddrinfo: Name or service not known
Feb 12 14:16:34 jabberwocky unbound[1084]: [1770905794] unbound[1084:0] fatal error: could not open ports
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Failed with result 'exit-code'.
Feb 12 14:16:34 jabberwocky systemd[1]: Failed to start unbound.service - Unbound DNS server.
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Scheduled restart job, restart counter is at 1.
Feb 12 14:16:34 jabberwocky systemd[1]: Starting unbound.service - Unbound DNS server...
Feb 12 14:16:34 jabberwocky (unbound)[1186]: unbound.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Feb 12 14:16:34 jabberwocky unbound[1186]: [1770905794] unbound[1186:0] error: node eno1:53 getaddrinfo: Name or service not known
Feb 12 14:16:34 jabberwocky unbound[1186]: [1770905794] unbound[1186:0] fatal error: could not open ports
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Failed with result 'exit-code'.
Feb 12 14:16:34 jabberwocky systemd[1]: Failed to start unbound.service - Unbound DNS server.
Feb 12 14:16:34 jabberwocky systemd[1]: unbound.service: Scheduled restart job, restart counter is at 2.

It looks like the system does not know which interface to use, despite the fact that I use eno1 as the listening interface (I wish to listen on all adresses of this interface).

server:
interface: eno1
use-syslog: yes
verbosity: 1

I’m not using unbound, but the configuration snippet you shared seems to be written in yaml.

yaml is very strict about its indentation and also about the indentation characters used. Have you checked that you are only using spaces (not tabs !!) and that the options are indented the right way and at the right level ? (i.e. verbosity: 1 looks like it is one space to far to the right in your paste)

2 Likes

Hum… OK, fair enough. I shall try to check.

But then, why is it possible to start the daemon after all boot process is done ?

could it be that the daemon is starting way too early, before the network is fully initialised ?

I had to make the service start after network is ready. I don’t know why it was not made this way natively.

[Unit]
Description=Unbound DNS server
Documentation=man:unbound(8)
After=network-online.target