From ca4de263184e2d62239cc6d63caf2a0812d492b5 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 4 Oct 2022 13:32:47 +0000 Subject: [PATCH] unbound-dhcp-leases-bridge: Fall back to the default domain When the bridge cannot detect a domain name for any of the leases, it uses localdomain which is not always the best choice. So instead, this patches changes the behaviour that we read the default domain of the firewall. Signed-off-by: Michael Tremer Reviewed-by: Bernhard Bitsch --- config/unbound/unbound-dhcp-leases-bridge | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index 1446c88dfd..e89e0446b4 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -441,8 +441,11 @@ class Lease(object): if address in subnet: return subnets[subnet] - # Fall back to localdomain if no match could be found - return "localdomain" + # Load main settings + settings = self.read_settings("/var/ipfire/main/settings") + + # Fall back to the host domain if no match could be found + return settings.get("DOMAINNAME", "localdomain") @staticmethod @functools.cache -- 2.39.5