Skip to content

Commit

Permalink
Merge pull request #47490 from akerouanton/25.0-47370_windows_nat_net…
Browse files Browse the repository at this point in the history
…work_dns

[25.0 backport] Set up DNS names for Windows default network
  • Loading branch information
akerouanton committed Mar 1, 2024
2 parents 0db1c6d + d66e0fb commit 41fde13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion daemon/container_operations.go
Expand Up @@ -649,7 +649,10 @@ func cleanOperationalData(es *network.EndpointSettings) {
}

func (daemon *Daemon) updateNetworkConfig(container *container.Container, n *libnetwork.Network, endpointConfig *networktypes.EndpointSettings, updateSettings bool) error {
if containertypes.NetworkMode(n.Name()).IsUserDefined() {
// Set up DNS names for a user defined network, and for the default 'nat'
// network on Windows (IsBridge() returns true for nat).
if containertypes.NetworkMode(n.Name()).IsUserDefined() ||
(serviceDiscoveryOnDefaultNetwork() && containertypes.NetworkMode(n.Name()).IsBridge()) {
endpointConfig.DNSNames = buildEndpointDNSNames(container, endpointConfig.Aliases)
}

Expand Down

0 comments on commit 41fde13

Please sign in to comment.