mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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 <rob.murray@docker.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -150,10 +150,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:"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user