diff --git a/src/etc/inc/plugins.inc.d/kea.inc b/src/etc/inc/plugins.inc.d/kea.inc
index 363e22cb8c..152bece1c2 100644
--- a/src/etc/inc/plugins.inc.d/kea.inc
+++ b/src/etc/inc/plugins.inc.d/kea.inc
@@ -86,11 +86,20 @@ function kea_staticmap($proto = null, $valid_addresses = true, $ifconfig_details
}
if (empty((string)$keamdl->general->enabled)) {
- /* not enabled */
- return $staticmap;
+ /* Skip only the disabled address family. */
+ continue;
}
foreach ($keamdl->reservations->reservation->iterateItems() as $reservation) {
+ $subnet_node = $keamdl->getNodeByReference("subnets.subnet{$proto}.{$reservation->subnet}");
+ if ($subnet_node && !$subnet_node->ddns_dns_server->isEmpty()) {
+ /*
+ * DDNS manages this subnet's records on the upstream DNS server. Local static records in
+ * Unbound or Dnsmasq could shadow those records and become stale, so skip registration here.
+ */
+ continue;
+ }
+
$hostname = !empty((string)$reservation->hostname) ? (string)$reservation->hostname : null;
$ip_address = (string)$reservation->ip_address;
if ($valid_addresses) {
@@ -109,16 +118,15 @@ function kea_staticmap($proto = null, $valid_addresses = true, $ifconfig_details
$description = !empty((string)$reservation->description) ? (string)$reservation->description : null;
+ /*
+ * DHCP domain and search options configure client name resolution and may differ from the domain
+ * used to register their hostnames. The dedicated qualifying suffix defines that registration domain
+ * for both DHCPv4 and DHCPv6, which aligns most closely with Kea's own DDNS model. Neither subnet
+ * nor reservation DHCP options are used here, since they should never influence this decision.
+ */
$domain = null;
- if ($proto == 4) {
- $subnet_node = $keamdl->getNodeByReference("subnets.subnet4.{$reservation->subnet}");
- if ($subnet_node) {
- if (!empty((string)$reservation->option_data->domain_name)) {
- $domain = (string)$reservation->option_data->domain_name;
- } elseif (!empty((string)$subnet_node->option_data->domain_name)) {
- $domain = (string)$subnet_node->option_data->domain_name;
- }
- }
+ if ($subnet_node && !$subnet_node->ddns_qualifying_suffix->isEmpty()) {
+ $domain = $subnet_node->ddns_qualifying_suffix->getValue();
}
$entry = [
diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet4.xml b/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet4.xml
index 72626b71d8..c64c08f32a 100644
--- a/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet4.xml
+++ b/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet4.xml
@@ -275,7 +275,6 @@
header
- truesubnet4.ddns_forward_zone
@@ -300,7 +299,7 @@
subnet4.ddns_qualifying_suffixtext
- If a DHCP client only sends a hostname in option 81, append this suffix to create an FQDN (e.g. "home.arpa.").
+ If a DHCP client only sends a hostname in option 81, append this suffix to create an FQDN (e.g. "home.arpa."). Also used as the domain for static reservations when registration is enabled in local DNS services. Static registration is skipped when an upstream DNS server is configured for this subnet.false
diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet6.xml b/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet6.xml
index 050880f80f..ce94f80a19 100644
--- a/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet6.xml
+++ b/src/opnsense/mvc/app/controllers/OPNsense/Kea/forms/dialogSubnet6.xml
@@ -142,7 +142,6 @@
header
- truesubnet6.ddns_forward_zone
@@ -167,7 +166,7 @@
subnet6.ddns_qualifying_suffixtext
- If a DHCP client only sends a hostname in option 81, append this suffix to create an FQDN (e.g. "home.arpa.").
+ If a DHCP client only sends a hostname in option 81, append this suffix to create an FQDN (e.g. "home.arpa."). Also used as the domain for static reservations when registration is enabled in local DNS services. Static registration is skipped when an upstream DNS server is configured for this subnet.false