如何使用Docker for Windows从Windows 10上的DNSparsingWindows容器IP?

从Windows 10主机如何通过主机名访问容器?

例如,如果我有两个容器

  • 容器一
  • 容器-B

我想能够从主机使用此命令,并将其parsing为容器-a的IP地址:

ping container-a 

我使用Windows容器模式在Windows 10上运行最新的稳定Docker for Windows。

我正在使用默认的“nat”networkingtypes,子网为172.20.16.0/20

在主机上,docker NIC详细信息:

 Ethernet adapter vEthernet (HNS Internal NIC): Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 172.20.16.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled 

和物理网卡的详细信息:

 Ethernet adapter Ethernet: DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 192.168.1.173(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : fe80::1:1%5 192.168.1.1 DHCP Server . . . . . . . . . . . : 192.168.1.1 DNS Servers . . . . . . . . . . . : 192.168.1.1 NetBIOS over Tcpip. . . . . . . . : Enabled 

主机NIC是否需要在其DNS列表中包含docker NIC的IP?