moby icon indicating copy to clipboard operation
moby copied to clipboard

Improve the test for a network that uses an internal DNS server

Open robmry opened this issue 2 years ago • 0 comments

Description

Follow up from https://github.com/moby/moby/pull/47375 ...

We should have an easy way to test for a network that need configuration for an internal DNS server. Hopefully we can use the same test to decide whether to start the internal nameserver.

IsUserDefined() is close, but misses some cases ... in the PR/issue linked above, it missed the default nat network on Windows (called "nat"), which does have an internal resolver listening on the bridge's address. As a consequence, DNS names for containers were not populated in that network.

In setupPathsAndSandboxOptions it misses swarm-scoped networks that do have an internal resolver. So, these networks end up using systemd's underlying nameservers instead of 127.0.0.53. (So, if the host's nameservers are updated, containers need a restart to pick up the new servers.)

There may be other places where the test could be improved.

robmry avatar Feb 13 '24 14:02 robmry