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 <michael.tremer@ipfire.org>
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org>
This commit is contained in:
Michael Tremer
2022-10-04 13:32:47 +00:00
committed by Peter Müller
parent a308f5bcde
commit ca4de26318

View File

@@ -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