From 9e4efb55f6d4f4883aa0eae0ecea65ae82d1ad10 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 8 Oct 2024 15:21:27 +0200 Subject: [PATCH] Update DNS plug-in on network change Restart the DNS plug-in on network change. This makes sure any potential host OS DNS configuration changes get picked up by the DNS plug-in as well. --- supervisor/host/network.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/supervisor/host/network.py b/supervisor/host/network.py index ef3aa3deafe..0b1e7d6f500 100644 --- a/supervisor/host/network.py +++ b/supervisor/host/network.py @@ -282,6 +282,11 @@ async def apply_changes( state = msg[0] _LOGGER.debug("Active connection state changed to %s", state) + # This potentially updated the DNS configuration. Make sure the DNS plug-in + # picks up the latest settings. + if not update_only: + await self.sys_plugins.dns.restart() + # update_only means not done by user so don't force a check afterwards await self.update(force_connectivity_check=not update_only)