Closed stefangrossmann closed 2 years ago
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.
Get valid ping or nslookup response using busybox docker image
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:
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
I've had the same experience with Docker Desktop for Windows versions 2.1.0.1 and 2.1.0.3.
Reset to factory defaults (as described here: https://docs.docker.com/docker-for-windows/#reset) also did not help.
I tried configuring the docker daemon dns
setting to be my domain DNS server, which knows how to resolve my local host's fully qualified DNS name. As others have experienced, this doesn't seem to help. In fact, resolution of the magical DNS name host.docker.internal
fails if I configure the docker daemon dns
in this fashion.
The solution of adding an extra_hosts
entry cannot be applied to all of my use-cases (in some cases, the compose file is not mine to manipulate).
I also don't have the option of using the magical host.docker.internal
DNS name, because I need a DNS name that resolves both inside the docker container, and in locally running scripts. (I'm using a JWT whose issuer is set to my local machine's FQDNS, and this JWT is used both locally and in the docker container.)
I've resorted to creating a script that essentially looks up the container which needs to resolve my local host by name, and invokes:
docker exec <container> /bin/sh -c "echo '<ip_address>\t<local_hostname>' >> /etc/hosts"
Some irony here: You can locally lookup your local host's IP address by a DNS lookup of host.docker.internal
, because Docker for Windows maintains that DNS name in your local C:\Windows\System32\drivers\etc\hosts
file. So, that makes it kinda easy to get your current IP address for the docker exec
command above.
Same problem and fix as everyone else. Had 2.1.0.2, no network or DNS configuration would resolve. Reverted to 2.0.0.3 and default network settings with automatic DNS works fine.
No news when trying 2.1.0.3 ... the issue still exists ...
It appears that 'fixed dns server' finally works again with version 2.1.0.4
I am not sure if this is the same issue, but docker DNS does not resolve hostname until you use FQDN. Example:
docker pull registry:8500/repo/image:tag
gives me
Error response from daemon: Get https://registry:8500/v2/: dial tcp: lookup registry on 192.168.65.1:53: no such host
but
docker pull registry.company.domain:8500/repo/image:tag
works
same with
docker run busybox ping registry
- not working
docker run busybox ping registry.company.domain
- working
docker desktop version: 2.1.0.4
all this used to work before
Issue is still not resolved for me when pinging local computer using internal company name FQDN. Other internal network computers are still reachable. Using Docker Desktop 2.1.0.4.
I wrote a workaround PowerShell cmdlet to fix running containers /etc/hosts based on the solution @dpmott posted. This is particularly handy for Kubernetes as there is no other workaround.
https://gist.github.com/michaeldahlke/8fd716b4a2e4cf4b585e1f92fe31dabd
Fixed DNS Server setting is still not observed in v2.1.0.5. Cannot push/pull from local registries using host name.
Related: #4425
Seeing similar issues with resolving container hostnames on the same network (or via docker-compose links) using the nat
driver. (cc: @mat007)
Client: Docker Engine - Enterprise
Version: 19.03.5
Git commit: 2ee0c57608
Built: 11/13/2019 08:00:16
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Enterprise
Engine:
Version: 19.03.2
API version: 1.40 (minimum version 1.24)
Go version: go1.12.8
Git commit: c92ab06ed9
Built: 09/03/2019 16:35:47
OS/Arch: windows/amd64
Experimental: true
I'm also suffered from this issue due to unknown issue. It works before.
C:\>docker run -it --rm --network=nat --isolation=process mcr.microsoft.com/windows/servercore:1909 nslookup go.microsoft.com
Server: UnKnown
Address: 172.29.16.1
*** UnKnown can't find go.microsoft.com: Server failed
Docker Version
C:\>docker version
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.24)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:28:48 2019
OS/Arch: windows/amd64
Experimental: false
I tried to re-install & downgrade to Docker Desktop 2.0.0.3
, it still not working.
I also tried to removed all the network interface, not working either.
Get-HnsNetwork | Remove-HnsNetwork
&"C:\Program Files\Docker\Docker\Docker for Windows.exe"
I also tried using --dns
or configure daemon.json
's dns
property. Not working.
docker run -it --rm --network=nat --dns="8.8.8.8" --isolation=process mcr.microsoft.com/windows/servercore:1909 nslookup go.microsoft.com
Is there any other workaround available right now?
@doggy8088 On Windows, docker ships with the nat
network. This is not a "user created" network therefore containers do not automatically get added to the built-in DNS server and will not resolve automatically. If you want that behavior, create your own, similar network using the nat driver, e.g. docker network create --driver nat --ipam-driver windows my-network-name
then attach your containers to that.
Docker may change this behavior (in our favor) very soon. For more information, see moby/moby#40357
@riverar I tried this:
docker network create --driver nat --ipam-driver windows mynat
docker run -it --rm --network=mynat --isolation=process mcr.microsoft.com/windows/servercore:1909 nslookup go.microsoft.com
Server: UnKnown
Address: 172.26.208.1
*** UnKnown can't find go.microsoft.com: Server failed
It's not working.
Issue still not resolved in Docker Desktop 2.2.0.0
I'm using a workaround by executing Set-DnsClientServerAddress
comdlet inside container.
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 8.8.8.8
Still not working in Docker Desktop 2.2.0.3 for me.
Still not working in Docker Desktop 2.2.0.3 for me.
Did you do a factory reset? I was in same situation some versions ago (<2.1) and after upgrade to major version 2.1 and execute a factory reset it works fine. Actually I'm using Docker Desktop 2.2.* without any problem...
@mrbrazzi I did a factory reset this morning, but this did not help as well.
Factory reset definitely does not fix this issue for me. To workaround the issue I just set the dns servers to use in the daemon configuration using the syntax below in the json config.
"dns": ["8.8.8.8"]
Just Add i.e. suffix ".home" in the compose file for the container Like that:
rabbitmq:
networks:
eshop_net:
aliases:
- rabbitmq.home
container_name: rabbitmq
hostname: rabbitmq
image: rabbitmq:3-management-alpine
ports:
- "15672:15672"
- "5672:5672"
Works fine For Docker EE on 2019
Same issue here! Been having a connection problem in our dev environments for a few months now and finally found the time to dig into it. Sure enough, after much troubleshooting, realized that Docker suddenly stopped resolving local network names, whereas our exact same containers worked perfectly fine in previous versions.
Here is docker-compose fragment which is worked fine. The core issue is dns service, not Docker , but linux images that used by 'net core' and so on. I have add alpine to "endless" run, which is perfect 5mb dns service for my network. In case it is easy to check what's up inside your container network, just attach to container.
version: '3.7'
services:
rabbitmq:
networks:
eshop_net:
aliases:
- rabbitmq.home #important alias
container_name: rabbitmq
hostname: rabbitmq
image: rabbitmq:3-management-alpine
ports:
- "15672:15672"
- "5672:5672"
alpinebox:
networks:
eshop_net:
aliases:
- alpinebox.home #important alias
container_name: alpinebox
hostname: alpinebox
image: alpine
entrypoint: /bin/sh
stdin_open: true
tty: true
networks:
eshop_net:
FWIW for me this is only a problem for hosts without a dot (.) in the name. For example mylanwebserver.com
resolves fine but MSSQLSERVER1
or SOMEONESWINDOWSPC
doesn't.
I am using allias with suffix '.home' in this case it works fine for names without it. See yaml example.
With:
{ "bridge" : "none" } At C:\ProgramData\Docker\config\daemon.json
I was able to pull from private container registry.
I'm not sure everyone who is following this issue has the same problem, but here is mine and what solved it for me:
I'm building a Docker Image that requires downloading a file from the internet. The step that downloads the file fails because the command was unable to resolve the hostname.
When I tried to ping any hostname; e.g., microsoft.com, I get Ping request could not find host microsoft.com. Please check the name and try again.
I followed a few of the suggestion in this issue, like resetting Docker to factory setting and using a custom network, but none worked with me.
What worked with me, however, was the suggestion here; I added the following to Docker Engine settings:
"dns": [
"1.1.1.1"
]
Thanks, @clawrenceks.
Running 2.3.02 on windows 1903 in experimental mode (mixed linux and windows containers) here and also having this issue.
Any linux container that does a hostname -i
during startup will fail, as the DNS will not resolve.
Tried a number of ideas to work around the problem, but came up empty.
Not having a working DNS is making dev on a Windows machine hard.
This issue is now > 12 months old is it even on the todo ?
This is still an issue for 2.3.03 (45519) and Windows 1809
@mikeparker @rn @akshaybabloo @gtardif @akimd @macdja38 @ebriney @duglin @MagnusS @dave-tucker
Is this issue on Docker's radar at all?
@mikeparker @rn @akshaybabloo @gtardif @akimd @macdja38 @ebriney @duglin @MagnusS @dave-tucker
Is this issue on Docker's radar at all?
I’m just a random person… I have no connection to docker and no idea if this is on their radar.
Edit: Sorry if the quote pinged anyone, I was on mobile and didn't even thing it might mention everyone again.
Sorry, I was going off the list of people who had committed to this docker/for-win
repo.
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:
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
It seems to be not possible to lookup the IP of the own host:
With external hosts and other machines inside our network everything works fine:
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