Improve the predicate for a network that uses an internal DNS server
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 72.1k
- Forks
- 19.2k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 164
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in daemon/container_operations_unix.go at setupPathsAndSandboxOptions, then trace how IsUserDefined() is used to decide internal DNS configuration. Compare the predicate against the default Windows "nat" network and swarm-scoped networks described in the issue. Done means the test identifies every network that has an internal resolver and avoids routing those networks through the wrong nameserver behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100