From: Michael Tremer Date: Tue, 4 Oct 2022 13:32:47 +0000 (+0000) Subject: unbound-dhcp-leases-bridge: Fall back to the default domain X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca4de263184e2d62239cc6d63caf2a0812d492b5;p=people%2Fms%2Fipfire-2.x.git 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 --- 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