diff --git a/core/services/beacon/main.py b/core/services/beacon/main.py index 4c4fee9b84..63ac7099de 100755 --- a/core/services/beacon/main.py +++ b/core/services/beacon/main.py @@ -113,7 +113,12 @@ def set_hostname(self, hostname: str) -> None: for interface in self.manager.settings.interfaces: match InterfaceType.guess_from_name(interface.name): case InterfaceType.WIRED | InterfaceType.USB: - interface.domain_names = [hostname, self.DEFAULT_HOSTNAME] # let's keep our default just in case + interface.domain_names = [ + old_name.replace(self.DEFAULT_HOSTNAME, hostname) for old_name in interface.domain_names + ] + # Let's keep our default just in case + if self.DEFAULT_HOSTNAME not in interface.domain_names: + interface.domain_names.append(self.DEFAULT_HOSTNAME) case InterfaceType.WIFI: interface.domain_names = [f"{hostname}-wifi"] case InterfaceType.HOTSPOT: