Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward DNS requests into --internal networks #47821

Merged
merged 1 commit into from May 14, 2024

Conversation

robmry
Copy link
Contributor

@robmry robmry commented May 10, 2024

- What I did

Fixes #47822

#47538 prevents containers only connected to --internal networks from communicating with external DNS servers - it also inadvertently prevents the daemon's internal DNS server from forwarding requests within an internal network to a containerised DNS server.

- How I did it

Relax the check, so that only requests that need to be forwarded from the host's network namespace are dropped.

External DNS servers remain unreachable from the internal network.

- How to verify it

New integration test.

- Description for the changelog

Fix a regression that prevented the use of DNS servers within a `--internal` network.

@robmry robmry force-pushed the internal_network_with_dns branch 2 times, most recently from af621b5 to b27e52b Compare May 10, 2024 15:38
@robmry robmry marked this pull request as ready for review May 10, 2024 16:28
Source: fname,
Target: "/etc/dnsd.conf",
}),
container.WithCmd("dnsd"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL dnsd in busybox.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too!

A recent change to prevent containers only connected to --internal
networks from communicating with external DNS servers inadvertently
prevented the daemon's internal DNS server from forwarding requests
within an internal network to a containerised DNS server.

Relax the check, so that only requests that need to be forwarded
from the host's network namespace are dropped.

External DNS servers remain unreachable from the internal network.

Signed-off-by: Rob Murray <[email protected]>
@robmry robmry force-pushed the internal_network_with_dns branch from b27e52b to 77a47db Compare May 10, 2024 18:37
@vvoland vvoland modified the milestones: 26.1.3, 27.0.0 May 14, 2024
@vvoland
Copy link
Contributor

vvoland commented May 14, 2024

I went ahead and created a backport to have this attached to the 26.1.3 milestone.

@akerouanton akerouanton merged commit 5505c85 into moby:master May 14, 2024
129 checks passed
@robmry robmry deleted the internal_network_with_dns branch May 15, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal network DNS fails to resolve
4 participants