Skip to content

Commit 33f9a53

Browse files
committed
Default to "windows-dns-proxy":true
In 26.1, we added daemon feature flag "windows-dns-proxy" which could be set to "true" to make "nslookup" work in Windows containers, by forwarding requests from the internal resolver to the container's external DNS servers. This changes the default to forwarding-enabled - it can be disabled by via daemon.json using ... "features": { "windows-dns-proxy": false } Signed-off-by: Rob Murray <[email protected]>
1 parent cd08d37 commit 33f9a53

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

daemon/container_operations_windows.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ func serviceDiscoveryOnDefaultNetwork() bool {
164164
}
165165

166166
func buildSandboxPlatformOptions(container *container.Container, cfg *config.Config, sboxOptions *[]libnetwork.SandboxOption) error {
167-
// By default, the Windows internal resolver does not forward requests to
168-
// external resolvers - but forwarding can be enabled using feature flag
169-
// "windows-dns-proxy":true.
170-
if doproxy, exists := cfg.Features["windows-dns-proxy"]; !exists || !doproxy {
167+
// By default, the Windows internal resolver forwards requests to external
168+
// resolvers - but forwarding can be disabled using feature flag
169+
// "windows-dns-proxy":false.
170+
if doproxy, exists := cfg.Features["windows-dns-proxy"]; exists && !doproxy {
171171
*sboxOptions = append(*sboxOptions, libnetwork.OptionDNSNoProxy())
172172
}
173173
return nil

integration/networking/resolvconf_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,7 @@ func TestNslookupWindows(t *testing.T) {
150150
defer c.ContainerRemove(ctx, res.ContainerID, containertypes.RemoveOptions{Force: true})
151151

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

0 commit comments

Comments
 (0)