Skip to content

Improve the predicate for a network that uses an internal DNS server #47378

@robmry

Description

@robmry

Description

Follow up from #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkingNetworkingkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions