Unbound + Wireguard & OpenVPN: Unbound doesn't start on boot

Trying to learn with my new Rpi. Read some guides and I now had Unbound and both Wireguard+OpenVPN installed (using PiVPN). Everything works except one thing:
Unbound doesn’t start on boot (I can still start it manually)

Output of journalctl -u unbound.service --no-pager

Nov 04 00:08:47 Pi3p-1 systemd[1]: Starting Unbound DNS server...
Nov 04 00:08:48 Pi3p-1 unbound[712]: [1667495328] unbound[712:0] error: can't bind socket: Cannot assign requested address for port 53
Nov 04 00:08:48 Pi3p-1 unbound[712]: [1667495328] unbound[712:0] fatal error: could not open ports
Nov 04 00:08:48 Pi3p-1 systemd[1]: unbound.service: Main process exited, code=exited, status=1/FAILURE
Nov 04 00:08:48 Pi3p-1 systemd[1]: unbound.service: Failed with result 'exit-code'.
Nov 04 00:08:48 Pi3p-1 systemd[1]: Failed to start Unbound DNS server.
Nov 04 00:08:48 Pi3p-1 systemd[1]: unbound.service: Scheduled restart job, restart counter is at 4.

( is the IP of Raspi in the main network)

A sudo netstat -ntlup doesn’t show anything using port 53.

The interesting thing is if I insert ExecStartPre=/bin/sleep 1 (only 1 second) into unbound.service file (at /etc/systemd/system/multi-user.target.wants), Unbound would start normally on boot.

Any advice on what might be the issue and what steps can I do to troubleshoot/solve it? Thanks.

Did you used dietpi-software to install unbound?

Oh hi, actually I’m on RasPi OS (Bullseye). Googled and found many topics about Unbound+WG+OVPN here, and don’t know if there is an official forum for RasPi, so I decided to post here.

First I installed Pi-hole + Unbound (apt install) + Wireguard (PiVPN). Then I uninstalled them all to start this “new” project.

I then installed Unbound (apt install) + Wireguard (install/uninstall several times) + OpenVPN

Don’t use apt, usedietpi-software to install everything. But before that, delete the already installed software (pihole, unbound, PiVPN etc)via apt and then run:
dietpi-software install 93 && dietpi-software install 182 && dietpi-software install 117

Also, if you use wireguard you don’t need openVPN. These are both VPN servers. But this will be all solved if you delete everything and install it via dietpi-software.

pls check the official RPI forum for questions on RPI OS https://forums.raspberrypi.com/index.php

We are specialized on DietPi. Which btw would be a better to run on your SBC. Way more automation and no need to manage thinks manually :wink:

@Jappe he is not using DietPi. It’s plain Rpi OS if I understood correctly.

Ooops, my bad. :sweat_smile:

1 Like

Thank you all @Joulinar @Jappe , thought it was not a complicated question (for you guys) and I might get a quick answer, but look like I should ask at the appropriate place :sweat_smile:

Favored Dietpi and chose to ask on this forum also because I tested the x86 version on my VM well… about 3 yrs ago :smile: I’m testing and playing with my new RasPi, so obviously I’ll try Dietpi soon :wink:

Do that as you could install all your software options with a single command on DietPi. No need to deal with configs and dependency :slight_smile:

1 Like