OPNsense Forum

English Forums => General Discussion => Topic started by: iorx on March 25, 2022, 08:11:21 PM

Title: Unbound restarts if "Register DHCP leases" is checked?
Post by: iorx on March 25, 2022, 08:11:21 PM
Hi!

Does Unbound restarts if "Register DHCP leases" is checked and when a new lease is registered in DHCP?

I'm in the transition from pfsense to OPNsense and this seems to be a hot potato, but rather old.., and is not solved over there. Got a link to where it was discussed, and to me (rather novice on this) it looks like a solution is given but not picked up.
Title: Re: Unbound restarts if "Register DHCP leases" is checked?
Post by: iorx on April 18, 2022, 08:11:28 PM
BUMP! Sorry for that, but curious and can't seem to find the answer.

To clarify the question. In pfSense the unbound service restart for every host resolve update, resulting in a moment of DNS absence for clients.

This "can" be solved by updating unbound without restart. As I understand through some "python mode" or some other technique.

This a long going issue. And a solution has been proposed but not implemented.
https://redmine.pfsense.org/issues/5413 (https://redmine.pfsense.org/issues/5413)
https://github.com/pfsense/FreeBSD-ports/blob/devel/sysutils/dhcpleases/files/dhcpleases.c (https://github.com/pfsense/FreeBSD-ports/blob/devel/sysutils/dhcpleases/files/dhcpleases.c)

So, does OPNsense "suffer" the same problem, restart of Unbound every time something is added/changed/removed to it?

Brgs,
Title: Re: Unbound restarts if "Register DHCP leases" is checked?
Post by: franco on April 19, 2022, 08:01:33 AM
Hi,

We use unbound-control to register DHCP leases on the fly:
https://github.com/opnsense/core/blob/3c59ca126928542d48e5df3df7b226022918a73e/src/opnsense/scripts/dns/unbound_dhcpd.py#L57-L60

Also, 21.7 added a "cache retain" feature for unbound restart which is enabled by default to make restarts seamless in terms of not invalidating the current cache contents.


Cheers,
Franco

Title: Re: Unbound restarts if "Register DHCP leases" is checked?
Post by: iorx on April 21, 2022, 10:36:32 PM
The source didn't do much for "me", looked nice though ;D pretty colours!
But your answer did! Thank you, then I know. I get a wholesome feeling that development of OPNsense is more solution and user oriented than the other product.
Soon to migrate my over complicated home network to OPNsense.
Title: Re: Unbound restarts if "Register DHCP leases" is checked?
Post by: franco on April 22, 2022, 08:52:16 AM
As with all things it takes time to incorporate these changes, but we try to listen to user concerns push through the difficulties when it can be solved from a core perspective.

Good luck with your migration. :)


Cheers,
Franco