Skip to content

Commit

Permalink
Update DNS plug-in on network change
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
agners committed Oct 9, 2024
1 parent 1ee01b1 commit 9e4efb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions supervisor/host/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9e4efb5

Please sign in to comment.