Skip to content

Windows container DNS problem when changing networks #22887

Open

Description

@friism

I think I've found a Windows container networking problem that's caused by changing networks.

I'm running Windows 10 with WS2016 TP5 in a Hyper-V VM.

I set up the VM in the Docker office, which happens to use Comcast. As mentioned in the docs, a NAT-style containernetwork is created automatically, and it'll get the current host DNS setup baked in. This can be checked with Get-ContainerNetwork | fl on the WS2016 guest, and shows that the DNS servers used are 75.75.75.75 and 75.75.75.76. These are Comcast's DNS servers.

Get-ContainerNetwork | fl
WARNING: Based on customer feedback, we are updating the Containers PowerShell module to better align with Docker. As part of that some cmdlet and parameter names may change in future releases. To
 learn more about these changes as well as to join in the design process or provide usage feedback please refer to http://aka.ms/windowscontainers/powershell


Name               : nat
SubnetPrefix       : {172.16.0.0/12}
Gateways           : {172.16.0.1}
Id                 : e11981e0-441e-4bb5-8030-9fad2c3ff2a4
Mode               : NAT
NetworkAdapterName :
SourceMac          :
DNSServers         : {75.75.75.75, 75.75.76.76}
DNSSuffix          : docker.com
IsDeleted          : False

The problem is when I move my Windows 10 laptop to a different network, for example my apartment where I use Sonic.net. Comcast's DNS servers will still be baked into the ContainerNetwork entry on the WS2016 host, but those are no longer useful, I think because Comcast refuses to respond to DNS queries not originating from their subscribers. This means that DNS no longer resolves from containers (the WS2016 hyper-v guest seems to be fine though - only the containernetwork is affected).

Removing and re-creating the containernetwork seems to solve the problem.

Note that --dns doesn't work with Windows containers.

cc @jhowardmsft @PatrickLang @neilpeterson

Activity

  1. lowenna commented on May 22, 2016

    @lowenna
    Member

    Actually networking should ping @msabansal

  2. neilpeterson commented on May 22, 2016

    @neilpeterson
    Contributor

    @friism this is a know issue. A bug being tracked by @JMesser81

  3. added
    kind/bug
    on May 22, 2016
  4. added this to the Windows TP5 milestone on May 22, 2016
  5. PatrickLang commented on Nov 17, 2016

    @PatrickLang

    @kallie-b this might be one for you to track

  6. kallie-b commented on Nov 18, 2016

    @kallie-b

    Yep, it seems to be! I'll get on it.

  7. jamiegs commented on Feb 25, 2019

    @jamiegs

    Has anything been done to help with this issue? It's been open for nearly 3 years. I've been having similar problems when networks change on windows.

  8. lowenna commented on Feb 25, 2019

    @lowenna
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugplatform/windows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions