Skip to content

Commit

Permalink
Merge pull request moby#47826 from robmry/windns_proxy_default
Browse files Browse the repository at this point in the history
Default to "windows-dns-proxy":true
  • Loading branch information
akerouanton authored May 21, 2024
2 parents c3a4087 + 33f9a53 commit 081f6ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions daemon/container_operations_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func serviceDiscoveryOnDefaultNetwork() bool {
}

func buildSandboxPlatformOptions(container *container.Container, cfg *config.Config, sboxOptions *[]libnetwork.SandboxOption) error {
// By default, the Windows internal resolver does not forward requests to
// external resolvers - but forwarding can be enabled using feature flag
// "windows-dns-proxy":true.
if doproxy, exists := cfg.Features["windows-dns-proxy"]; !exists || !doproxy {
// By default, the Windows internal resolver forwards requests to external
// resolvers - but forwarding can be disabled using feature flag
// "windows-dns-proxy":false.
if doproxy, exists := cfg.Features["windows-dns-proxy"]; exists && !doproxy {
*sboxOptions = append(*sboxOptions, libnetwork.OptionDNSNoProxy())
}
return nil
Expand Down
7 changes: 2 additions & 5 deletions integration/networking/resolvconf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,7 @@ func TestNslookupWindows(t *testing.T) {
defer c.ContainerRemove(ctx, res.ContainerID, containertypes.RemoveOptions{Force: true})

assert.Check(t, is.Equal(res.ExitCode, 0))
// Current default is to not-forward requests to external servers, which
// Current default is to forward requests to external servers, which
// can only be changed in daemon.json using feature flag "windows-dns-proxy".
// So, expect the lookup to fail...
assert.Check(t, is.Contains(res.Stderr.String(), "Server failed"))
// When the default behaviour is changed, nslookup should succeed...
//assert.Check(t, is.Contains(res.Stdout.String(), "Addresses:"))
assert.Check(t, is.Contains(res.Stdout.String(), "Addresses:"))
}

0 comments on commit 081f6ba

Please sign in to comment.