Control: tag -1 + moreinfo
On Tue, 27 Jul 2021 18:05:51 -0400 Marcus Furlong <furlo...@gmail.com> wrote:
Package: unbound
Version: 1.9.0-2+deb10u2
When starting unbound and binding to a specific interface using the
`interface` keyword, unbound can fail if the interface is not
configured correctly on boot.
Changing the systemd unit to use the `network-online.target` instead
of the `network.target` remedies the situation. Once the interface is
online, unbound succeeds in binding to the interface and starts
correctly.
If you explicitly specified an interface name for unbound to bind
to in the config file, you can just as easily specify the dependency
for systemd. Something like, in /etc/systemd/system/unbound.service.d/,
local-dep.conf:
Requires = yourwifi.netdev
(I don't know how off-hand to specify network devices in the Requires
section of the systemd units, - this is just to give you an idea).
The problem here is like chicken-n-egg problem. In some configurations,
in order to bring network online, one have to have a working name
resolution already. For example, it is quite normal when you have
a VPN setup and require it to operate before you declare the network
is online (so you have protected communications). But this VPN might
require DNS resolution to work in order to find the other endpoint.
I think it is easier to configure dependency on the particular
host-specific interface when you know it is really necessary to
bind to that interface, than to switch to a later stage in the
system startup.
There's one more possibility: if you know an IP address of that
interface, you can assign that address to loopback interface
(with /32 netmask) _before_ bringing that interface up, and specify
an IP address in the unbound.conf instead of the interface name.
This way all it will work fine too.
Is this enough for you to fix your configuration?
Thanks,
/mjt