Troubleshoot Windows Docker container network

Troubleshoot Windows Docker container network

Problems

  • unable to resolve host google.com
  • Ping request could not find host google.com. Please check the name and try again.
  • UnKnown can't find google.com: Server failed

Solution

C:\>ping github.com
Ping request could not find host github.com. Please check the name and try again.

C:\>nslookup github.com
Server:  UnKnown
Address:  172.19.128.1

*** UnKnown can't find github.com: Server failed

C:\>netsh interface ipv4 show interfaces

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  4          75  4294967295  connected     Loopback Pseudo-Interface 2
  5          15        1500  connected     Ethernet 2


C:\>nslookup github.com
Server:  UnKnown
Address:  172.19.128.1

*** UnKnown can't find github.com: Server failed

C:\>powershell Set-DnsClientServerAddress -InterfaceIndex 4 -ServerAddresses 8.8.8.8

C:\>nslookup github.com
Server:  UnKnown
Address:  172.19.128.1

*** UnKnown can't find github.com: Server failed

C:\>powershell Set-DnsClientServerAddress -InterfaceIndex 5 -ServerAddresses 8.8.8.8

C:\>nslookup github.com
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
Name:    github.com
Addresses:  140.82.118.3
          140.82.118.4