在Windows 10上托pipe的Windows容器将丢失其DNS

我正面临这种情况,我的基于Windows的容器失去了解决DNS的能力。

这是发生了什么事

启动一个容器来testingdnsparsingdocker run -it microsoft/windowsservercore powershell

从容器内部

Test-NetConnection google.com -Port 443

失败

PS C:> Test-NetConnection google.com -Port 443警告:google.com的名称parsing失败 – 状态:这通常是主机名parsing过程中的临时错误,并且意味着本地服务器没有收到来自授权服务器的响应计算机名称:google.com RemoteAddress:InterfaceAlias:SourceAddress:PingSucceeded:False

但应该是这样的

PS C:\ Users \ asarafian> Test-NetConnection google.com -Port 443计算机名称:google.com RemoteAddress:216.58.204.14 RemotePort:443 InterfaceAlias:vEthernet(外部虚拟交换机)SourceAddress:10.98.5.139 TcpTestSucceeded:True

我经常保持工作站(Windows 10),并在其上运行Hyper-V实例和Docker。 工作站是Windows 10,从我可以告诉什么时候发生的问题是,它使用Windows 10主机的IP作为DNS。

从容器内

 PS C:\> ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : c7c016e13be8 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #2 Physical Address. . . . . . . . . : Deducted DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::bc61:e687:4676:353a%5(Preferred) IPv4 Address. . . . . . . . . . . : 172.19.143.229(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : 172.19.128.1 DHCPv6 IAID . . . . . . . . . . . : Deducted DHCPv6 Client DUID. . . . . . . . : Deducted DNS Servers . . . . . . . . . . . : 172.19.128.1 NetBIOS over Tcpip. . . . . . . . : Disabled 

172.19.128.1是我的Windows 10主机IP。

同时,当Windows 10主机容器卡住时,其他所有内容都正常parsingDNS。

  • Windows 10上的任何进程。
  • Windows 10上的Hyper-V实例。
  • 容器托pipe在Windows 10上的Hyper-V实例上。

重新启动机器不能解决问题。 这是第二次发生这种情况。 以前,我不得不重置整个docker安装来解决这个问题。 我想避免这一点,并理解问题是什么以及如何解决这个问题。

docker版本是

 C:\Users\asarafian>docker version Client: Version: 17.03.1-ce-rc1 API version: 1.27 Go version: go1.7.5 Git commit: 3476dbf Built: Wed Mar 15 20:33:22 2017 OS/Arch: windows/amd64 Server: Version: 17.03.1-ce-rc1 API version: 1.27 (minimum version 1.24) Go version: go1.7.5 Git commit: 3476dbf Built: Wed Mar 15 20:33:22 2017 OS/Arch: windows/amd64 Experimental: false 

更新1 – 20170408

根据@ chris-lawrence评论的要求,以下是来自主机和容器内部的ipconfig /all 。 有趣的是,dnsparsing从容器内部起作用。

在容器里面

 PS C:\> ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : 476d22f638ea Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : home Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : home Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #2 Physical Address. . . . . . . . . : 00-15-5D-53-0A-2A DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::ad59:83cc:6e64:944a%5(Preferred) IPv4 Address. . . . . . . . . . . : 172.19.132.10(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : 172.19.128.1 DHCPv6 IAID . . . . . . . . . . . : 83891549 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-20-7A-A9-D0-00-15-5D-53-0A-2A DNS Servers . . . . . . . . . . . : 172.19.128.1 192.168.0.1 NetBIOS over Tcpip. . . . . . . . : Disabled 

在容器主机上

 Windows IP Configuration Host Name . . . . . . . . . . . . : MECDEVASAR03 Primary Dns Suffix . . . . . . . : global.sdl.corp Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : global.sdl.corp sdl.corp maidenhead.sdl.corp sheffield.sdl.corp development.sheffield.sdl.corp irv.languageweaver.com languageweaver.com montreal.sdl.corp singapore.sdl.corp bray.sdl.corp seoul.sdl.corp idiominc.priv sdlproducts.com lan.lon.sdlproducts.com freetranslation.corp xyenterprise.com alterian.com ams.dev sdlntt.corp Ethernet adapter vEthernet (HNS Internal NIC): Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter Physical Address. . . . . . . . . : 00-15-5D-53-04-CB DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::f5c8:e8c7:1ad0:d845%26(Preferred) IPv4 Address. . . . . . . . . . . : 172.19.128.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : DHCPv6 IAID . . . . . . . . . . . : 436213085 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-AD-0A-F4-18-DB-F2-15-03-E7 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 vEthernet (External Virtual Switch): Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : global.sdl.corp Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2 Physical Address. . . . . . . . . : 18-DB-F2-15-03-E7 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Local Area Connection* 2: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter Physical Address. . . . . . . . . : B8-08-CF-44-25-D9 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : home Description . . . . . . . . . . . : Intel(R) Dual Band Wireless-AC 8260 Physical Address. . . . . . . . . : B8-08-CF-44-25-D8 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::6d3a:ef28:a057:6108%18(Preferred) IPv4 Address. . . . . . . . . . . : 192.168.0.103(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Lease Obtained. . . . . . . . . . : Saturday, 8 April 2017 16:17:24 Lease Expires . . . . . . . . . . : Saturday, 15 April 2017 16:24:09 Default Gateway . . . . . . . . . : 192.168.0.1 DHCP Server . . . . . . . . . . . : 192.168.0.1 DHCPv6 IAID . . . . . . . . . . . : 45615311 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-AD-0A-F4-18-DB-F2-15-03-E7 DNS Servers . . . . . . . . . . . : 192.168.0.1 NetBIOS over Tcpip. . . . . . . . : Enabled Ethernet adapter Bluetooth Network Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Bluetooth Device (Personal Area Network) Physical Address. . . . . . . . . : B8-08-CF-44-25-DC DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.global.sdl.corp: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : global.sdl.corp Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.{5C890AAE-6E73-44BB-BB1E-DE8EB4794BF8}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.home: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : home Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes 

出于好奇,我已经检查了hyper-v实例的状态,并且它们closures了。 我的感觉是,当hyper-v(s)发生什么奇怪的事时。 我大多怀疑当一个hyper-v实例运行时系统从hybernation恢复时会发生一些奇怪的事情。 我会做一个检查….

我做了检查,一切都还好。 但是hyper-v(s)是为有线networking适配器设置的,因此在WIFI上就没有networking。 可能是在这种情况下,他们不会干预。

更新2 – 20170411

根据@ chris-lawrence注释的请求,以下是来自主机和networking容器内的有问题ipconfig /all 。 在这一刻,容器主机上的防火墙被closures,正如@GSA所build议的那样。

在容器里面

PS C:> ipconfig / all

 Windows IP Configuration Host Name . . . . . . . . . . . . : d4e9a6d59f93 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Hyper-V Network Adapter #2 Physical Address. . . . . . . . . : 00-15-5D-53-00-71 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::a08a:68b:1c3d:fe6e%5(Preferred) IPv4 Address. . . . . . . . . . . : 172.19.135.4(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : 172.19.128.1 DHCPv6 IAID . . . . . . . . . . . : 83891549 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-20-7E-30-BE-00-15-5D-53-00-71 DNS Servers . . . . . . . . . . . : 172.19.128.1 NetBIOS over Tcpip. . . . . . . . : Disabled 

我注意到,只有一个 dns条目172.19.128.1这是内部泊坞窗。

在容器主机上

 Windows IP Configuration Host Name . . . . . . . . . . . . : MECDEVASAR03 Primary Dns Suffix . . . . . . . : global.sdl.corp Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : global.sdl.corp sdl.corp maidenhead.sdl.corp sheffield.sdl.corp development.sheffield.sdl.corp irv.languageweaver.com languageweaver.com montreal.sdl.corp singapore.sdl.corp bray.sdl.corp seoul.sdl.corp idiominc.priv sdlproducts.com lan.lon.sdlproducts.com freetranslation.corp xyenterprise.com alterian.com ams.dev sdlntt.corp Ethernet adapter vEthernet (HNS Internal NIC): Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter Physical Address. . . . . . . . . : 00-15-5D-53-04-CB DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::f5c8:e8c7:1ad0:d845%26(Preferred) IPv4 Address. . . . . . . . . . . : 172.19.128.1(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.240.0 Default Gateway . . . . . . . . . : DHCPv6 IAID . . . . . . . . . . . : 436213085 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-AD-0A-F4-18-DB-F2-15-03-E7 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 vEthernet (External Virtual Switch): Connection-specific DNS Suffix . : global.sdl.corp Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2 Physical Address. . . . . . . . . : 18-DB-F2-15-03-E7 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::5814:8934:3247:a4bf%10(Preferred) IPv4 Address. . . . . . . . . . . : 10.98.5.139(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.0.0 Lease Obtained. . . . . . . . . . : Tuesday, 11 April 2017 08:08:21 Lease Expires . . . . . . . . . . : Wednesday, 19 April 2017 08:08:20 Default Gateway . . . . . . . . . : 10.98.1.1 DHCP Server . . . . . . . . . . . : 10.98.3.7 DHCPv6 IAID . . . . . . . . . . . : 504945650 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1F-AD-0A-F4-18-DB-F2-15-03-E7 DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1 10.98.3.7 10.98.3.5 10.20.3.169 Primary WINS Server . . . . . . . : 10.100.3.100 NetBIOS over Tcpip. . . . . . . . : Enabled Wireless LAN adapter Local Area Connection* 2: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter Physical Address. . . . . . . . . : B8-08-CF-44-25-D9 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Ethernet adapter Bluetooth Network Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Bluetooth Device (Personal Area Network) Physical Address. . . . . . . . . : B8-08-CF-44-25-DC DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Ethernet adapter vEthernet (Wireless External Virtual Switch): Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : global.sdl.corp Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #3 Physical Address. . . . . . . . . : B8-08-CF-44-25-D8 DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.global.sdl.corp: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : global.sdl.corp Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.{5C890AAE-6E73-44BB-BB1E-DE8EB4794BF8}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes 

更新3 – 问题修复

我刚刚升级到Windows 10的创造者更新,突然问题已经停止。 目前,我认为这个问题是通过Windows Update来解决的。 但是对于有类似问题的人来说,我只是在一个星期后就更新了,我不认为这是问题所在。 如果它再次发生,可以看看。