Docker Community Forums

Share and learn in the Docker community.

DNS not working when container runs on Windows in process isolation mode

Hi,

I came across strange issue. When I run a container on my Windows 10 or Server 2019 in process isolation mode it seems the DNS from within the container doesn’t work. When I run the same container in hyperv mode all works just fine.

Container example:

ARG  BASE=nanoserver
ARG  VERSION=1809-amd64
FROM mcr.microsoft.com/windows/${BASE}:${VERSION}
ENTRYPOINT ["ping"]
CMD ["www.google.com"]

Build as:

docker build -t ping .

When executed in hyperv mode I get this output:

docker run --isolation=hyperv ping www.google.com

Pinging www.google.com [74.125.193.105] with 32 bytes of data:
Reply from 74.125.193.105: bytes=32 time=10ms TTL=46
Reply from 74.125.193.105: bytes=32 time=12ms TTL=46
Reply from 74.125.193.105: bytes=32 time=17ms TTL=46
Reply from 74.125.193.105: bytes=32 time=25ms TTL=46

When executed in process isolation mode it fails:

docker run --isolation=process ping www.google.com
Ping request could not find host www.google.com. Please check the name and try again.

When executed with an IP address instead of host name it also works fine:

docker run --isolation=process ping 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=10ms TTL=53
Reply from 8.8.8.8: bytes=32 time=14ms TTL=53
Reply from 8.8.8.8: bytes=32 time=12ms TTL=53
Reply from 8.8.8.8: bytes=32 time=8ms TTL=53

I checked and in both cases the container is attached to the same network (nat) on my computer. Comparing the output from docker image inspect doesn’t show any significant differences except in places where you’d expect (like time, name, etc.) but no difference in network settings.

In both cases the output from ipconfig from inside the container looks very similar:
Hyperv:

Link-local IPv6 Address . . . . . : fe80::92c:5fb5:ed93:f552%4
IPv4 Address. . . . . . . . . . . : 192.168.220.121
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.208.1

Process:

Link-local IPv6 Address . . . . . : fe80::8d1e:34fd:f32e:ec73%66
IPv4 Address. . . . . . . . . . . : 192.168.214.233
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.208.1

Any ideas? Am I missing some configuration or command line parameter here?
Thank you.
Petr

Windows 10 - Pro, version 1809, Docker Desktop Community 2.1.0.1, engine 19.03.1