Windows 10上托管的Windows容器丢失其DNS

时间:2017-04-07 09:11:34

标签: docker docker-windows

我遇到这种情况,我的基于Windows的容器失去了解析DNS的能力。

这就是发生的事情

启动容器以测试dns解析 docker run -it microsoft/windowsservercore powershell

从容器内部

Test-NetConnection google.com -Port 443

失败
  

PS C:> Test-NetConnection google.com -Port 443   警告:google.com的名称解析失败 - 状态:这通常是主机名解析期间的临时错误,表示本地服务器未收到来自权威服务器的响应   ComputerName:google.com   远程地址:   InterfaceAlias:   来源地址:   PingSucceeded:False

但应该是这样的

  

PS C:\ Users \ asarafian> Test-NetConnection google.com -Port 443   ComputerName:google.com   RemoteAddress:216.58.204.14   RemotePort:443   InterfaceAlias:vEthernet(外部虚拟交换机)   来源地址:10.98.5.139   TcpTestSucceeded:True

我总是对工作站(Windows 10)进行混乱,并在其上运行Hyper-V实例和Docker。工作站是Windows 10,从问题发生时我可以看出它是用作DNS的Windows 10主机的IP。

从容器内

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主机容器卡住时,其他所有内容都会正常解析DNS。

  • Windows 10上的任何进程。
  • Windows 10上的Hyper-V实例。
  • Container托管在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。有趣的方面是dns解析在容器内部起作用。

在容器内

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

出于好奇,我检查了超级v实例的状态,然后它们就关闭了。我的感觉是,当超级v时,会发生一些奇怪的事情。当一个超级v实例运行时,当系统从h​​ybernation恢复时,我大多怀疑发生了一些奇怪的事情。我会检查......

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

更新2 - 20170411

根据@ chris-lawrence评论的请求,以下是来自主机的ipconfig /all以及来自网络上的容器内的容器。此时,容器主机上的防火墙已关闭,正如@GSA建议的那样。

在容器内

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修复了该问题。但是对于遇到类似问题的人来说,我在更新方面只落后一周,我不相信这就是问题所在。如果它再次发生就被看到。

2 个答案:

答案 0 :(得分:0)

其中一个Docker示例告诉您运行此命令:

for event in pygame.event.get():
    if event.type == pygame.QUIT:
        gameExit = True
    if event.type == pygame.KEYDOWN:
        if event.key == pygame.K_RIGHT:
            pressedRight = True
    if event.type == pygame.KEYUP:
        if event.key == pygame.K_RIGHT:
            pressedRight = False

# Now in your game loop
if pressedRight:
    location += 1

这应该解决Windows容器中DNS的一些问题。不确定它会对你有所帮助,但值得一试。

答案 1 :(得分:0)

似乎晚了,但我刚遇到此错误。也许这可以对将来的人有所帮助。

我不知道这是否是唯一原因,但是每次建立vpn连接时都会收到此错误。我使用的是Big-IP Edge Client,但它不应该是唯一的。

断开客户端连接可恢复容器内的网络

在docker ping和dns查找之外,一切正常。

HTH