From 56e8e433393ba9c8eb06cabbafb195f5045cf9d8 Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Fri, 28 Nov 2025 09:47:07 +0100 Subject: [PATCH] Revert "libnet: populateNetworkResourcesOS: updateDNS only if !needResolver" This reverts commit 937246a86837bb8d76725eef64696d1364bc6289. Signed-off-by: Albin Kerouanton --- daemon/libnetwork/sandbox_linux.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/daemon/libnetwork/sandbox_linux.go b/daemon/libnetwork/sandbox_linux.go index 878ff44495..27a37dfd8c 100644 --- a/daemon/libnetwork/sandbox_linux.go +++ b/daemon/libnetwork/sandbox_linux.go @@ -366,11 +366,6 @@ func (sb *Sandbox) populateNetworkResourcesOS(ctx context.Context, ep *Endpoint) if ep.needResolver() { sb.startResolver(false) - } else { - // Make sure /etc/resolv.conf is set up. - if err := sb.updateDNS(ep.getNetwork().enableIPv6); err != nil { - return err - } } if i != nil && i.srcName != "" { @@ -453,6 +448,10 @@ func (sb *Sandbox) populateNetworkResourcesOS(ctx context.Context, ep *Endpoint) } sb.addHostsEntries(ctx, ep.getEtcHostsAddrs()) + // Make sure /etc/resolv.conf is set up. + if err := sb.updateDNS(ep.getNetwork().enableIPv6); err != nil { + return err + } // Populate load balancer only after updating all the other // information including gateway and other routes so that