unbound forgets forwarder set via dhcp when config is reloaded

Bug #1675192 reported by Malte S. Stretz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unbound (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

unbound is integrated quite nicely with resolvconf. When a system boots up and eth0 is configured via dhcp and gets a DHCP server, the forwarder is set properly. When you restart unbound, the forwarder is set properly as well.

But if you reload the config, the forwarder is forgotten since the resolvconf update script isn't called:

root@ip-172-31-20-36:~# unbound-control forward
172.31.0.2
root@ip-172-31-20-36:~# service unbound reload
root@ip-172-31-20-36:~# unbound-control forward
off (using root hints)

root@ip-172-31-20-36:~# unbound-control forward 172.31.0.2
ok
root@ip-172-31-20-36:~# unbound-control forward
172.31.0.2
root@ip-172-31-20-36:~# service unbound restart
root@ip-172-31-20-36:~# unbound-control forward
172.31.0.2

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: unbound 1.5.8-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-66.87-generic 4.4.44
Uname: Linux 4.4.0-66-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
Date: Wed Mar 22 21:38:25 2017
Ec2AMI: ami-5aee2235
Ec2AMIManifest: (unknown)
Ec2AvailabilityZone: eu-central-1b
Ec2InstanceType: t2.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: unbound
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Malte S. Stretz (mss) wrote :
Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello,

Thank you for filing this bug report!

This seems like an issue that comes from the Debian packaging of unbound. Would you be willing to file a bug with them to see what they think should be changed in /etc/init.d/unbound?

Thanks,
Nish

Changed in unbound (Ubuntu):
status: New → Triaged
Revision history for this message
Nish Aravamudan (nacc) wrote :

Also, I note that in 17.04 (unlike 16.04), there is a unbound-resolvconf.service which has:

[Unit]
Description=Unbound DNS server via resolvconf
After=unbound.service
PartOf=unbound.service
ConditionFileIsExecutable=/sbin/resolvconf

[Service]
RemainAfterExit=yes
ExecStart=/usr/lib/unbound/package-helper resolvconf_start
ExecStop=/usr/lib/unbound/package-helper resolvconf_stop

[Install]
WantedBy=unbound.service

which I believe causes it to follow the reloads of unbound.service.

I'm not entirely sure if that's true, though, as PartOf appears to only propgate starts/stops (and thus restarts), but not reloads (there is a separate directive for this).

Also, I am unable to reproduce the behavior you see in 16.04 (both restarts and reloads lose the state) afaict in 17.04?

Revision history for this message
Nish Aravamudan (nacc) wrote :

I must be missing something obvious, as well.

When I run `service unbound restart` after specifying a forwarder with `unbound-control` first, `unbound-control forward` reports 'off (using root hints)' afterwards. This is in a VM using DHCP for its IP address. Is there some additional configuration I'm missing?

Revision history for this message
Malte S. Stretz (mss) wrote :

Thanks for triaging. I think you are right, restarts loose the forwarders as well. At least most the time, I think I saw one instance where it didn't happen but maybe the DHCP lease happened to be renewed at the same time or I just imagined it.

Revision history for this message
Malte S. Stretz (mss) wrote :

A good environment to test this is actually AWS where I noticed this :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.