Skip to content

Conversation

@olljanat
Copy link
Contributor

@olljanat olljanat commented Oct 20, 2025

- What I did
Decision in #19474 seems to be that there is no option to disable embedded DNS but user can provide own DNS servers with --dns option. However that logic does not exist in Windows version of overlay driver so I fixed that.

- How I did it
Copy & paste logic from non-overlay driver:

endpointStruct.DNSServerList = strings.Join(epOption.DNSServers, ",")

- How to verify it
Create attachable test network:

docker network create --driver overlay --attachable test

Start test container:

docker run -it --rm --network=test --dns=1.1.1.1 mcr.microsoft.com/windows/nanoserver:ltsc2025

NOTE! In Windows, gateway is always first DNS server inside of the container but internally DNS server(s) provided by user are used. That can be confirmed by testing with both valid and invalid DNS server IP addresses.

- Human readable description for the release notes

- The Windows overlay network driver now supports option `--dns`.

@thaJeztah thaJeztah added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/networking Networking area/networking/d/overlay Networking labels Oct 20, 2025

// Todo: Add port bindings and qos policies here

epOption, err := windows.ParseEndpointOptions(epOptions)
Copy link
Contributor

@robmry robmry Oct 20, 2025

Choose a reason for hiding this comment

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

At the moment, it looks we just ignore options like com.docker.network.endpoint.macaddress in this case ... after this change we'll return an error if those options are malformed, then still ignore them. Which might be even more confusing/annoying?

Maybe it'd be marginally better to continue ignoring those other options, by splitting a ParseDNSServers out of parseEndpointOptions and calling that from here?

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
Copy link
Contributor

@robmry robmry left a comment

Choose a reason for hiding this comment

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

LGTM - thank you.

@thaJeztah thaJeztah added this to the 29.0.0 milestone Oct 21, 2025
@thaJeztah
Copy link
Member

@robmry do we need a change-log entry for this one? (Also not sure if there's docs mentioning "doesn't work on Windows")

@robmry
Copy link
Contributor

robmry commented Oct 21, 2025

@robmry do we need a change-log entry for this one? (Also not sure if there's docs mentioning "doesn't work on Windows")

I don't see any docs to be updated, I've added a release note.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit bdc7474 into moby:master Oct 21, 2025
218 of 220 checks passed
@olljanat olljanat deleted the win-overlay-custom-dns branch October 22, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine area/dependencies area/networking/d/overlay Networking area/networking Networking impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants