Skip to content

Conversation

robmry
Copy link
Contributor

@robmry robmry commented May 22, 2025

- What I did

When nftables is enabled, use nftables instead of iptables to redirect DNS requests from containers to the internal DNS resolver.

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@robmry robmry self-assigned this May 22, 2025
@robmry robmry added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny area/networking Networking area/networking/firewalling Networking labels May 22, 2025
@robmry robmry force-pushed the nftables_internal_dns branch from 77388b4 to f6e3127 Compare May 28, 2025 13:31
@robmry robmry added this to the 29.0.0 milestone May 28, 2025
@robmry robmry marked this pull request as ready for review May 28, 2025 14:19
@@ -16,14 +18,22 @@ const (
postroutingChain = "DOCKER_POSTROUTING"
)

func (r *Resolver) setupIPTable() error {
func (r *Resolver) setupNAT() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're already touching this function signature and all call sites, it seems like an ideal opportunity to do a touch of context plumbing.

Suggested change
func (r *Resolver) setupNAT() error {
func (r *Resolver) setupNAT(ctx context.Context) error {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This unexported method is only called from one (exported) method, which has no context. So it's a bit futile but, done.

Signed-off-by: Rob Murray <rob.murray@docker.com>
@robmry robmry force-pushed the nftables_internal_dns branch from f6e3127 to d3289dd Compare May 29, 2025 16:23
@robmry robmry modified the milestones: 29.0.0, 28.2.2 May 29, 2025
@robmry robmry merged commit 768cfae into moby:master May 29, 2025
190 of 191 checks passed
@robmry robmry deleted the nftables_internal_dns branch May 29, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking/firewalling Networking area/networking Networking kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants