diff --git a/supervisor/host/network.py b/supervisor/host/network.py index ef3aa3deafe..5058c316815 100644 --- a/supervisor/host/network.py +++ b/supervisor/host/network.py @@ -10,7 +10,9 @@ from ..dbus.const import ( DBUS_ATTR_CONNECTION_ENABLED, DBUS_ATTR_CONNECTIVITY, + DBUS_ATTR_PRIMARY_CONNECTION, DBUS_IFACE_NM, + DBUS_OBJECT_BASE, DBUS_SIGNAL_NM_CONNECTION_ACTIVE_CHANGED, ConnectionStateType, ConnectivityState, @@ -148,6 +150,15 @@ async def _check_connectivity_changed( connectivity_check: bool | None = changed.get(DBUS_ATTR_CONNECTION_ENABLED) connectivity: bool | None = changed.get(DBUS_ATTR_CONNECTIVITY) + # This potentially updated the DNS configuration. Make sure the DNS plug-in + # picks up the latest settings. + if ( + DBUS_ATTR_PRIMARY_CONNECTION in changed + and changed[DBUS_ATTR_PRIMARY_CONNECTION] + and changed[DBUS_ATTR_PRIMARY_CONNECTION] != DBUS_OBJECT_BASE + ): + await self.sys_plugins.dns.restart() + if ( connectivity_check is True or DBUS_ATTR_CONNECTION_ENABLED in invalidated