From cea9e1619a0b150b08d5481f01546b7a898aad01 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Oct 2024 11:30:12 +0200 Subject: [PATCH] resolved: refresh resolv.conf files when link goes away This might have the effect that some DNS server or search domain disappears, hence rewrite the relevant files. See: #27543 (cherry picked from commit 562f7bde8872b4fd03db11bf25c9dd294fd2c186) (cherry picked from commit 72806073770393982a50aed54c40164105c9bf14) (cherry picked from commit 1de3aa4ec90cfa3f6568426982207141a1feabf0) --- src/resolve/resolved-manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index e6715ab574..cfb049aeb8 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -93,6 +93,9 @@ static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void * log_debug("Removing link %i/%s", l->ifindex, l->ifname); link_remove_user(l); link_free(l); + + /* Make sure DNS servers are dropped from written resolv.conf if their link goes away */ + manager_write_resolv_conf(m); } break;