26.7.10, unbound and Kea static lease domains

Started by keeka, November 24, 2026, 06:43:48 PM

Previous topic - Next topic
I just upgraded to 26.7.10 and noticed change of behaviour with unbound resolving some local names (static dhcp hosts under Kea). I restored 26.7.9 as I was not in a position to look in to it further and forgot to check generated contents /var/unbound/host_entries.conf.
Unbound appears not to be picking up Kea subnet domain when it has been set explicitly in a subnet's DHCP domain option. Unbound will only resolve the respective hosts under the default domain.

I wanted to offer a migration but at the same time we didn't know as it was a bit of an assumption.

Its documented here:

https://github.com/opnsense/docs/commit/10c01b996cb0b9ed3e12f5d09bef2b2fd2e22510
Hardware:
DEC740

Many thanks @Monviech. I will make sure to set that option once I've rerun the upgrade.
I have been using a custom unbound snippet in order to prevent additional domains from being resolved upstream:
#/usr/local/etc/unbound.opnsense.d/custom.conf
local-zone: "local.lan" static
Is this still OK?

Nothing about Unbound was changed so I think thats okay.
Hardware:
DEC740

Yet there was a change. I saw that on one machine as well. As it turns out, I had to include the local domain in the subnet definitions of Kea in the "search domains" and also change the machine name domain to make it work.

I did not investigate much, but I found that only the machine name domain got appended to an unqualified DNS entry. In my case, that was a FQDN.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, Leox LXT-010H-D

1100 down / 450 up, Bufferbloat A+

I have set the desired domain in Kea subnet's DDNS `DNS qualifying suffix` as well as retaining existing DHCP `Domain Name` option. The hosts concerned now resolve as required. Having now read the docs, deriving Unbound's host overrides from DDNS domain suffix rather than the DHCP domain option makes sense.

Regarding Kea, I'm still not quite sure how OPNsense's Kea config varies with `Auto collect option data` enabled vs disabled. AIUI this has no bearing on the subnet's DHCP Domain option. Only on how it sets Gateway, DNS and NTP server options, possibly others.

Auto collect option data sets gateway, dns server etc... from the system configuration. If you disable it, these fields are all manual. It shouldn't really influence anything else.

https://github.com/opnsense/core/blob/f1c1cde32eb1c0fc4cad4863009da5322a5f9cb8/src/opnsense/mvc/app/models/OPNsense/Kea/KeaDhcpv4.php#L62-L64
Hardware:
DEC740

Thanks again @Monviech. It was the 'etc' that prompted my query.

So the Auto option is literally system as gateway, dns and ntp. Whereas DHCP domain, when empty, is set to that of the system regardless.

Today at 02:32:14 PM #8 Last Edit: Today at 03:02:47 PM by Monviech (Cedrik)
Auto collect option data does not influence the DHCPv4 domain name option.

When the subnet's Domain name field is empty, the system domain is added during configuration generation:

https://github.com/opnsense/core/blob/f1c1cde32eb1c0fc4cad4863009da5322a5f9cb8/src/opnsense/mvc/app/models/OPNsense/Kea/KeaDhcpv4.php#L169-L174

I find that a bit unexpected too; theoretically, the fallback could also depend on Auto collect option data.

https://github.com/opnsense/core/pull/11314
Hardware:
DEC740