Hello All,
Using Docker Desktop v4.34.2 on Windows 11. My container image is built on top of Microsoft Server Core (ltsc2022). When I launch my container using the following run command (specifically using process isolation), I get no DNS address assigned inside the container:
docker run -it --entrypoint cmd --network nat --isolation=process <my-image-name>
Running ipconfig/all
from within the container returns:
Windows IP Configuration
Host Name . . . . . . . . . . . . : 85078ebf23d2
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter vEthernet (Ethernet):
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Container Adapter
Physical Address. . . . . . . . . : 00-15-5D-68-BB-01
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::7d6d:7518:5103:63d2%54(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.177.153(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.176.1
NetBIOS over Tcpip. . . . . . . . : Disabled
If I try an nslookup
from inside the container I get no address resolution, eg:
C:\mydir>nslookup "www.google.com"
*** Default servers are not available
Server: UnKnown
Address: 127.0.0.1
*** UnKnown can't find www.google.com: No response from server
If I specify a DNS server address manually to nslookup
(inside the container) I get a response (so clearly the IP routing is working):
C:\mydir>nslookup "www.google.com" 192.168.176.1
Server: UnKnown
Address: 192.168.176.1
Non-authoritative answer:
Name: www.google.com
Addresses: 2404:6800:4015:802::2004
142.250.70.196
When I try the same docker run operation without the “–isolation=process” parameter (ie. Hyper-V isolation) the launched container has a DNS server address assigned, per output below:
Windows IP Configuration
Host Name . . . . . . . . . . . . : 526fd9d724ad
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : REDACTEDx.REDACTEDy.com.au
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : REDACTEDx.REDACTEDy.com.au
Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter
Physical Address. . . . . . . . . : 00-15-5D-68-BD-61
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::58a0:1c7e:b7f:3753%4(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.191.18(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . : 192.168.176.1
DHCPv6 IAID . . . . . . . . . . . : 67114333
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2E-8B-CC-13-00-15-5D-68-BD-61
DNS Servers . . . . . . . . . . . : 192.168.176.1
172.17.0.2
NetBIOS over Tcpip. . . . . . . . : Disabled
I have tried to work around this issue by forcibly setting the DNS Server Address using Set-DNSClientServerAddress in powershell (within the container), but the address fails to “stick”, and remains empty when checked with Get-DNSClientServerAddress.
Does anyone have any ideas on how to resolve?
Many thanks for your assistance.