KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces
-
In 25.03.b.20250507.1611, I just noticed a quirk relating to early DNS registration in KEA DHCPv6 when using Tracked Interfaces. I am leaning towards considering it an actual bug in this setup:
a) One of my VLANs is configured with IPv6 tracking the WAN (DHCPv6).
b) The DHCPv6 static mapping for the two devices on the VLAN are
- If I enable Early DNS Registration the clients will be given an additional IPv6 address, the static mapping IPv6 address. "Given" here only means that an nslookup would show the invalid address, I can't see that the client actually uses the address
They way this ought to work (IMHO) is that for a tracked interface, the IP given to the clients and registered with unbound are only given
- once the WAN IPv6 PD is known/received, and
- then it would consist of only the subnet address+mapping address.
This was how it used to work in 24.11 if I recall. But this "Early DNS registration" is new in 25.03? Both /var/unbound/host_entries.conf and /etc/hosts gets updated with these incorrect IP addresses.
So, is this a bug?
(... and I wonder what happens if I give it a static mapping address of ::1 ...
)
edit1: updated nslookup pic to show that the correct address is also given to client (..::cf50::3)
-
So just to be clear this only happens when you enable early lease registration?
And the client itself doesn't get given that lease? It's just resolving to that?
-
@stephenw10 said in KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces:
So just to be clear this only happens when you enable early lease registration?
yes, as soon as I enable early registration the "::3" gets added to the files I mentioned.
And the client itself doesn't get given that lease?
No, I tcpdumped the DHCP doing a ipconfig/release6 and ipconfig/renew6 from the machine in question, and it gets a valid IPv6 address.
It's just resolving to that?
yes
Not knowing the interwork between KEA and Unbound it looks like unbound is told that "::3" is a valid address for the machine.
Early registration of a static IP address will always be fine as the mapping includes the complete address, but on tracked interfaces the mapping is what gets appended to the subnet derived from the WAN PD. It should be fairly trivial in KEA to check the type of IPv6 configuration on the interface and decide how and when to update Unbound (IMHO). And in this case the PD has already been received and the valid prefix is available, so adding an empty "::3" is plainly wrong.
-
Yup that seems like a bug.
Does the invalid address timeout from Unbound after some time?
-
@stephenw10 said in KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces:
Does the invalid address timeout from Unbound after some time?
It is now 40 minutes since the addresses got added to /var/unbound/host_entries.conf and /etc/hosts (i.e the last time they were written to) so I would say a "timeout" and automatic removal seems unlikely...
-
-
@pst said in KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces:
In 25.03.b.20250507.1611, I just noticed a quirk relating to early DNS registration in KEA DHCPv6 when using Tracked Interfaces
This issue exists for a while now, since kea was introduced ?
I 'solved' it by changing my DHCPv6 static lease from :
to
A ::cc as an IPv6 seems awkward, but ... actually understandable.
The non-present part before de :: is the prefix, the one being 'tracked'.
A prefix can change 'anytime' !!
The actual IPv6 is the prefix + the "::cc".Declaring/using/making such a "::cc" DHCPv6 static lease and you wind up with this :
in the /etc/hosts file .... and that looks wrong.
Let's check :C:\Users\Gauche>nslookup epackferpar22 Serveur : pfSense.bhf.tld Address: 2a01:cb19:907:a6e2:92ec:77ff:fe29:392c Nom : epackferpar22.bhf.tld Addresses: ::cc 192.168.1.26
= not good.
My temporary solution : use the real GUAs for my
and now, the moment my prefix changes, "everything breaks".
I'm lucky, my prefix doesn't change often (once a year ?)The issue is (imho) is that the DHCPv6 static leases are stored in the config.xml like this :
The
<ipaddrv6>::cc</ipaddrv6>
can't be used as-is. It should be prepended with the current LAN/OPTx tracked prefix before being written to /etc/hosts/ (and / or being fed into unbound etc).
Even pfBlockerng uses this :<ipaddrv6>::cc</ipaddrv6>
as-is, so reverse lookup won't work anymore.
-
Exactly, it should only be valid once a prefix has been obtained and not added anywhere until then.
-
@Gertjan said in KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces:
This issue exists for a while now, since kea was introduced ?
No, it was introduced in the 25.03-beta, it used to work in 24.11. I think it is caused by the introduction of the "early DNS registration" (which btw is also causing me some issues on IPv4, but I add a separate thread for that...)
Your "fix" will only work as long as the prefix doesn't change, which in the real world it rarely seems to do, so a sensible work-around IMHO.
-
@pst said in KEA DHCPv6: bug (?) with early DNS registration for Tracked Interfaces:
I think it is caused by the introduction of the "early DNS registration" (which btw is also causing me some issues on IPv4, but I add a separate thread for that...)
The issue I had noted wrt IPv4 (that static mappings were sometimes ignored and pool addresses used instead) was in the previous beta, and I have now tried to reproduce those in the current beta but failed, so we can put that to bed: there are no issues with KEA DCHP IPv4