Cannot resolve host name in Docker Desktop Windows
- [X] I have tried with the latest version of my channel: Edge - Version 2.0.3.0
- [X] I have uploaded Diagnostics
- Diagnostics ID: C4933176-FB5F-49FF-BFCF-8AB9EA6947EE/20190425111912
Expected behavior
Assuming, my machine is named workstation-mine.company.network, with IP 10.11.12.13
When calling docker run busybox ping workstation-mine.company.network I would expect that my workstation is reachable from within a docker container.
Actual behavior
The result of the ping is:
ping: bad address 'workstation-mine.company.network'
Information
When I pass the IP of the company-dns it is working:
docker run --dns COMPANY_DNS_IP busybox ping workstation-mine.company.network
PING workstation-mine.company.network (172.25.35.141): 56 data bytes
64 bytes from 172.25.35.141: seq=0 ttl=37 time=1.654 ms
64 bytes from 172.25.35.141: seq=1 ttl=37 time=0.937 ms
64 bytes from 172.25.35.141: seq=2 ttl=37 time=1.333 ms
64 bytes from 172.25.35.141: seq=3 ttl=37 time=1.657 ms
It seems to be not possible to lookup the IP of the own host:
docker run busybox nslookup workstation-mine.company.network
Server: 192.168.65.1
Address: 192.168.65.1:53
** server can't find workstation-mine.company.network: NXDOMAIN
*** Can't find workstation-mine.company.network: No answer
With external hosts and other machines inside our network everything works fine:
docker run busybox ping other-workstation-mine.company.network
PING other-workstation-mine.company.network (10.11.12.14): 56 data bytes
64 bytes from 172.25.35.161: seq=0 ttl=37 time=3.755 ms
64 bytes from 172.25.35.161: seq=1 ttl=37 time=1.752 ms
64 bytes from 172.25.35.161: seq=2 ttl=37 time=1.721 ms
64 bytes from 172.25.35.161: seq=3 ttl=37 time=1.854 ms
64 bytes from 172.25.35.161: seq=4 ttl=37 time=3.148 ms
64 bytes from 172.25.35.161: seq=5 ttl=37 time=1.561 ms
64 bytes from 172.25.35.161: seq=6 ttl=37 time=1.560 ms
The behaviour is the same with if I use 'automatic' DNS-Discovery or if I use a fixed DNS-Server at my docker-settings.
See as well a stackoverflow post from another user which seems to have the same problem: https://stackoverflow.com/questions/55360231/how-to-make-docker-desktop-windows-resolve-the-host-name
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
Still valid. But no coment, nothing :-( /remove-lifecycle stale
I upgraded to 2.1.0.0 today and am now experiencing the same issue. Manually setting DNS Server fixed to internal company DNS does not solve the issue. I've tried factory resetting and rebooting with no effect. Only way to resolve internal addresses is by passing --dns argument with docker run. So far I have found no workaround at all for Kubernetes.
Getting the same behavior as @michaeldahlke , had to revert back to 2.0.0.3
Same behavior as @stefangrossmann. I upgraded to 2.1.0.0 today.
- [x] I have tried with the latest version of my channel (Stable or Edge)
- [x] I have uploaded Diagnostics
- Diagnostics ID: E37D09A7-F695-4F6A-9380-A544CF140879/20190804194525
- Windows Version: Windows 10 Pro 1809 build 17763.379
- Docker Desktop Version: 2.1.0.0

Expected behavior
Get valid ping or nslookup response using busybox docker image
Actual behavior

The ip address that appears as nameserver in /etc/resolv.conf is assigned automatic by Docker according to Network settings.

If I set the DNS configuration fixed in Docker, the result is the same. See the following images:
- This my local ip configuration:

- Apply fixed DNS configuration and restart Docker

- Using ping and nslookup in busybox. Check that busybox not have the same DNS ip address that is setted in DNS configuration in Docker
but, if I set --dns option with docker run command, the result is the same,
also, if I change the daemon configuration in Docker, same result, see the following images:

Same problem as @michaeldahlke too. Setting the dns fixed does not affect anything.
Same problem here. Name resolution of containers inside the same docker-network is not working either. Edit: My bad containers can see each other, however name resolution of the host name is not working. Not in 2.1.0.1 either.
Same problem. I had to downgrade to 2.0.0.3. It is working properly.
If using docker-compose than extra_hosts is a workaround: https://docs.docker.com/compose/compose-file/#extra_hosts
Same behavior as @stefangrossmann. I upgraded to 2.1.0.0 today.
- [x] I have tried with the latest version of my channel (Stable or Edge)
- [x] I have uploaded Diagnostics
- Diagnostics ID: E37D09A7-F695-4F6A-9380-A544CF140879/20190804194525
- Windows Version: Windows 10 Pro 1809 build 17763.379
- Docker Desktop Version: 2.1.0.0
Expected behavior
Get valid ping or nslookup response using busybox docker image
Actual behavior
The ip address that appears as nameserver in /etc/resolv.conf is assigned automatic by Docker according to Network settings.
If I set the DNS configuration fixed in Docker, the result is the same. See the following images:
- This my local ip configuration:
- Apply fixed DNS configuration and restart Docker
- Using ping and nslookup in busybox. Check that busybox not have the same DNS ip address that is setted in DNS configuration in Docker
but, if I set --dns option with docker run command, the result is the same,
also, if I change the daemon configuration in Docker, same result, see the following images:
![]()
I upgrade to version 2.1.01 (37199). The problem persist.
Confirming that this isn't resolved in 2.1.0.1. I have upgraded to both 2.1.0.0 and 2.1.0.1 and the issue is in both versions. I resolved it by downgrading to previous version 2.0.0.3.
@jredp Is it possible to downgrade without loosing the existing containers and images?
Same problem
@jredp Is it possible to downgrade without loosing the existing containers and images?
I'm sorry @tze I am not sure on that one. It depends on how they do the uninstall and if they fully clean out those during the uninstaller process. I had to run the uninstaller and then install to "downgrade". In other words, not an actual rollback. I pull a docker image when I run so I don't need to worry about existing images.
Another version came out today. I don't see a comment from anyone that they have reviewed this bug. I'm not sure how to tell. Though, to be fair, it looks like they have 678 issues right now in Docker for Win.
This also applies to Docker-ee on Windows Server 2019.
It seems the /etc/hosts file is not generated or mounted into the docker container, whereas /etc/resolv.conf seems right.
I'm using Docker 2.1.0.2 for windows, the problem is still there
Hi, I found a solution... I'm using Docker 2.1.0.2 and after execute a Reset to factory defaults everything's work fine... I run a container with busybox image, execute ping to google.com.cu and receive a valid ICMP response... also I compile a project that require download libraries with pip and it worked fine!!!
I hope this radical solution can help you...
Happy hacking!!!
Thanks @mrbrazzi Reset to factory defaults with Docker 2.1.x also worked for me :)
How can I reset to factory defaults with Docker-ee on Windows Server 2019 ?
Reset to factory defaults is not working with Docker Desktop for Windows. I have version 2.1.0.3.
Problem:
I have an artifactory go repo on a company VPN. When building a docker image I need to be able to pull libraries from artifactory; thus I need to set the DNS Server to the VPN's dns. This has worked in previous version of Docker Desktop but no longer. I get the following error whether the DNS Server is set to Automatic or Fixed
dial tcp: lookup artifactory.dev.companyname.net on 192.168.65.1:53: no such host
Expected: When I set DNS Server to Fixed, that DNS server is used instead of 8.8.8.8.
The last version where Fixed DNS Server worked is 2.0.0.3 2019-02-15