Windows Containers hosted on Windows 10 lose their DNS

I’m facing this situation where my windows based containers lose their ability to resolve DNS.

I always hybernate the workstation and on it I operate Hyper-V instances and Docker. The workstation is Windows 10 and from what I can tell when the problem happens is that it uses as DNS the ip of the Windows 10 host. On the same time that the Windows 10 host containers are stuck, everything else resolves DNS normally.

  • Any process on Windows 10.
  • Hyper-V instances on Windows 10.
  • Container’s hosted on Hyper-V instances on Windows 10.

If I restart the machine then problem gets fixed but I’m not sure as this is the third time that this happens. I’m trying not to restart until I can provide some answers to questions and we figure out what goes wrong.

Restarting the windows 10 os didn’t fix the problem.

To start a container to test dns resolving

docker run -it microsoft/windowsservercore powershell

From inside the container

Test-NetConnection google.com -Port 443

Fails with

PS C:> Test-NetConnection google.com -Port 443
WARNING: Name resolution of google.com failed – Status: This is usually a temporary error during hostname resolution
and means that the local server did not receive a response from an authoritative server

ComputerName : google.com
RemoteAddress :
InterfaceAlias :
SourceAddress :
PingSucceeded : False

but should be something like this

PS C:\Users\asarafian> Test-NetConnection google.com -Port 443

ComputerName : google.com
RemoteAddress : 216.58.204.14
RemotePort : 443
InterfaceAlias : vEthernet (External Virtual Switch)
SourceAddress : 10.98.5.139
TcpTestSucceeded : True