如何使用Docker for Windows从Windows 10上的DNS解析Windows容器IP?

时间:2017-08-04 17:01:30

标签: windows docker dns docker-for-windows windows-container

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

例如,如果我有两个容器

  • 容器一
  • 容器-B

我希望能够从主机使用此命令并将其解析为container-a的IP地址:

ping container-a

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

我使用默认的“nat”网络类型,子网为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?

0 个答案:

没有答案