for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such host

Open RohitPatel1122 opened this issue 7 years ago • 76 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID:E422A821-D6AD-4B30-8EC2-1AFE3159A04C/20191007161034

Expected behavior

Docker should be able to pull image and run it

Actual behavior

Gives error with no such host

Information

  • Is it reproducible? Yes
  • Windows Version: 10
  • Docker Desktop Version: 2.1.0.3

Steps to reproduce the behavior

docker run hello-world

Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such host.
See 'docker run --help'

I tried to change the DNS in docker desktop settings to 8.8.8.8 but still same issue.

RohitPatel1122 avatar Oct 07 '19 16:10 RohitPatel1122

Hi. I have this same issue on both Docker for Windows and Docker on Ubuntu. Using Docker engine 19+.

Related: https://github.com/docker/for-mac/issues/1849

On windows, nslookup looks good, I can browse my repository just fine. But upon pulling: Error response from daemon: Get http://my-registry:5000/v2/: dial tcp: lookup my-registry on 192.168.65.1:53: no such host

Workaround is to put the FQDM in hosts file on Windows/Ubuntu.

This problem occurs even though I have set proper DNS options in daemon.json.

In the log file you can see it spamming:

[01:10:14.707][VpnKit            ][Info   ] vpnkit.exe: ICMP: destination unreachable from 192.168.65.3

MikaelUmaN avatar Oct 16 '19 06:10 MikaelUmaN

Hi, I have a problem that looks like yours. I have Docker desktop engine 19.03.1.

I trying to execute Docker search commad (docker search Ubuntu), but I get an error like this:

Error response from daemon: Get https://index.docker.io/v1/search?q=ubuntu&n=25: dial tcp: lookup index.docker.io on 192.168.65.1:53: read udp 192.168.65.3:34142->192.168.65.1:53: i/o timeout

I have been looking for this problem and what people do in order to solve it is uninstall and install. I have tried that but it doesn't work. I have tried to change the DNS Server to 8.8.8.8, and one more time, it doesn't work.

Do you know how I can fix this problem?

Thank you

bmorata avatar Oct 16 '19 07:10 bmorata

@MikaelUmaN i tried by adding below line to hosts file but no success: 192.168.65.1:53 docker

Any other things workaround that i can try

RohitPatel1122 avatar Oct 19 '19 13:10 RohitPatel1122

In your hosts file, add the ip and name of the host you are trying to reach.

Not the bogus 192.168.65.1:53

MikaelUmaN avatar Oct 19 '19 19:10 MikaelUmaN

Having the same issue on Ubuntu 18.04.

averri avatar Nov 07 '19 21:11 averri

You need to add to your /etc/hosts:

34.228.211.243  registry-1.docker.io

averri avatar Nov 07 '19 21:11 averri

I am having a similar issue. I do not see a hosts file in my docker directory. Where is this typically found?

aarn660 avatar Dec 16 '19 23:12 aarn660

@averri @MikaelUmaN It worked. Thank you both. @aarn660 path: C:\Windows\System32\drivers\etc

RohitPatel1122 avatar Dec 17 '19 10:12 RohitPatel1122

So the internal docker DNS Server is not working correctly? (e.g. the one listening at 192.168.65.1?) changing the default dns in the settings does not help me, and this issue occurs also for connections from the containers, so not only when pulling an image, for me.

kmindi avatar Jan 10 '20 11:01 kmindi

I have this issue also. Service 'dev-portal' failed to build: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: read udp 10.0.2.15:50375->10.0.2.3:53: i/o timeout

$ docker --version
Docker version 19.03.1, build 74b1e89e8a

OS: Windows 10

michaelday008 avatar Jan 29 '20 17:01 michaelday008

Same here on Linux, Fedora 31. $ docker --version Docker version 19.03.5, build 633a0ea838

xundeenergie avatar Feb 09 '20 00:02 xundeenergie

Same problem on CentOS 7 & KVM

# docker -v
Docker version 19.03.6, build 369ce74a3c

Commented here: https://github.com/docker/kitematic/issues/718#issuecomment-586660969

yhojann-cl avatar Feb 16 '20 03:02 yhojann-cl

Hi, Got the issue too on my windows. I had to uninstall Docker, then uninstall Hyper V, reboot, reinstall Hyper V, reboot and then install Docker. I can finally make a docker pull haha :)

jarnix avatar Feb 20 '20 17:02 jarnix

Just adding my 2 cents worth. I get the error on pulls, pushes, logins, etc. from my local registry. e.g.:

docker login <local-fqdn-of-registry:port>1
Username: <user>
Password: <password>
Error response from daemon: Get https://<local-fqdn-of-registry:port>/v2/: dial tcp: lookup <local-fqdn-of-registry> on 192.168.65.1:53: no such host
  1. In the Docker Desktop application I have configured the DNS manually for our local DNS server.
  2. Pings and nslookups are fine from the Windows host.
  3. DNS works fine inside my containers - I have configured "dns" and "dns-search" entries in my daemon.json to the same local DNS server.
  4. No proxies are in use at all
  5. Many restarts and reboots doesn't help

HOWEVER, the work around to add the entries to my windows hosts file DOES work. It's just very unappealing for all my users to have to do that.

Can I capture anything else to help move the fix along? Try something else?

[Edit: Docker Desktop 2.2.0.3, Docker version 19.03.5, build 633a0ea]

iwilliamson avatar Feb 20 '20 19:02 iwilliamson

I've encountered this too with a clean Windows and Docker installation. Docker was sitting there for a month before I started to use it. Meanwhile my local IP was changed a couple of times.

I noticed that there are multiple "hosts" file entries for each of these local IPs that Docker put there in the mean time. They seemed like harmless outdated duplicates but may possibly cause errors.

192.168.5.153 host.docker.internal
192.168.5.153 gateway.docker.internal
192.168.1.25 host.docker.internal
192.168.1.25 gateway.docker.internal
192.168.1.23 host.docker.internal
192.168.1.23 gateway.docker.internal
192.168.1.26 host.docker.internal
192.168.1.26 gateway.docker.internal
# Added by Docker Desktop
192.168.1.21 host.docker.internal
192.168.1.21 gateway.docker.internal
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section

So I've closed Docker. Deleted all of these entries. Relaunched Docker and let it create only the necessary entries this time. Then everything worked alright. They should be harmless so I'm probably missing some details here. But the problem solved anyway.

CanBaycay avatar Apr 13 '20 12:04 CanBaycay

When docker.io changes ip address we are all going to run out of service xD, many of us are manually changing the docker.io ip addresses to make this work, in the long term it will be a problem.

yhojann-cl avatar Apr 13 '20 19:04 yhojann-cl

I had this issue when using WLS, where Linux is only the client. I restarted Docker Desktop and it resolved the error.

SamHennessy avatar Apr 15 '20 01:04 SamHennessy

Had the same problem with Debian 9 and upgrading UNMS to a latest version. @averri workaround worked well, although the new IP at this time was 54.152.200.115. So thank you!

dbeato avatar Apr 25 '20 10:04 dbeato

I opened my "etc/hosts" file in notepad, couldn't save it. I which application i must open it so that i can save it as well?

kimmy-star avatar May 11 '20 15:05 kimmy-star

I opened my "etc/hosts" file in notepad, couldn't save it. I which application i must open it so that i can save it as well?

You need to open as sudo nano /etc/hosts or sudo vi /etc/hosts

dbeato avatar May 11 '20 16:05 dbeato