Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #4884

Open
2 tasks done
RohitPatel1122 opened this issue Oct 7, 2019 · 75 comments

Comments

@RohitPatel1122
Copy link

RohitPatel1122 commented Oct 7, 2019

  • I have tried with the latest version of my channel (Stable or Edge)
  • 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.

@MikaelUmaN
Copy link

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

Related: docker/for-mac#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

@bmorata
Copy link

bmorata commented Oct 16, 2019

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

@RohitPatel1122
Copy link
Author

@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

@MikaelUmaN
Copy link

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

@averri
Copy link

averri commented Nov 7, 2019

Having the same issue on Ubuntu 18.04.

@averri
Copy link

averri commented Nov 7, 2019

You need to add to your /etc/hosts:

34.228.211.243  registry-1.docker.io

@aarn660
Copy link

aarn660 commented Dec 16, 2019

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

@RohitPatel1122
Copy link
Author

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

@kmindi
Copy link

kmindi commented Jan 10, 2020

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.

@michaelday008
Copy link

michaelday008 commented Jan 29, 2020

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

@xundeenergie
Copy link

xundeenergie commented Feb 9, 2020

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

@yhojann-cl
Copy link

yhojann-cl commented Feb 16, 2020

Same problem on CentOS 7 & KVM

# docker -v
Docker version 19.03.6, build 369ce74a3c

Commented here: docker/kitematic#718 (comment)

@jarnix
Copy link

jarnix commented Feb 20, 2020

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 :)

@iwilliamson
Copy link

iwilliamson commented Feb 20, 2020

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]

@CanBaycay
Copy link

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.

@yhojann-cl
Copy link

yhojann-cl commented Apr 13, 2020

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.

@SamHennessy
Copy link

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

@dbeato
Copy link

dbeato commented Apr 25, 2020

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!

@kimmy-star
Copy link

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?

@dbeato
Copy link

dbeato commented May 11, 2020

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

@yhojann-cl
Copy link

yhojann-cl commented May 11, 2020

Notepad does not exist in Linux, maybe you are using Windows, you must edit C:\Windows\system32\drivers\etc\hosts.

The current hosts are:

$ date
lun 11 may 2020 18:18:04 -04
$ host registry-1.docker.io
registry-1.docker.io has address 34.195.246.183
registry-1.docker.io has address 52.1.121.53
registry-1.docker.io has address 3.211.199.249
registry-1.docker.io has address 23.22.155.84
registry-1.docker.io has address 3.94.35.164
registry-1.docker.io has address 35.174.73.84
registry-1.docker.io has address 3.218.162.19
registry-1.docker.io has address 3.224.175.179

@dbeato
Copy link

dbeato commented May 11, 2020

Notepad does not exist in Linux, maybe you are using Windows, you must edit C:\Windows\system32\drivers\etc\hosts.

The current hosts are:

$ date
lun 11 may 2020 18:18:04 -04
$ host registry-1.docker.io
registry-1.docker.io has address 34.195.246.183
registry-1.docker.io has address 52.1.121.53
registry-1.docker.io has address 3.211.199.249
registry-1.docker.io has address 23.22.155.84
registry-1.docker.io has address 3.94.35.164
registry-1.docker.io has address 35.174.73.84
registry-1.docker.io has address 3.218.162.19
registry-1.docker.io has address 3.224.175.179

You are right, I was referring to Linux on my commands. i use Hostfile editor for my Windows devices.
https://hostsfileeditor.com/

@mehrheer
Copy link

open your docker settings, if you aren't signed in to docker hub, sign in and check again. It worked for me

@kimmy-star
Copy link

kimmy-star commented May 18, 2020 via email

@menadio
Copy link

menadio commented May 23, 2020

My development system's power pack got fried and had to grab a temp system. Installed Docker desktop and had a similar issue. Restarted docker and that fixed it for me without changing any config.

@kimmy-star
Copy link

kimmy-star commented May 23, 2020 via email

@vidurpunj
Copy link

received same error on Cent OS, tried the same command multiple times, it worked after multiple tries.
you can try changeling the /etc/hosts file to
34.228.211.243 registry-1.docker.io
but remove that line in the end and it worked even without this line, the error could be due to the remote host could be busy at that point and didn't responded correctly.

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days 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

@tdmiller
Copy link

/remove-lifecycle stale

@dcorazolla
Copy link

/remove-lifecycle stale

@daffinito
Copy link

I ran into a similar issue on Ubuntu and it ended up being the proxy settings for the service config in /etc/systemd/system/docker.service.d/http-proxy.conf. They were set to an old proxy that didn't exist anymore. I just removed the file (I don't need a proxy anymore) sudo rm /etc/systemd/system/docker.service.d/http-proxy.conf, then did systemctl daemon-reload and systemctl restart docker, and issue was resolved.

@Camuvingian
Copy link

This is honestly a nightmare, I am on Windows 10, running the latest Docker. Tried PC reboot, Docker Engine restart. Login with access token, change the host file with the new addresses. Updated the config.json, reset the config.json - NOTHING. Can anybody offer any further advice?

@Camuvingian
Copy link

Removing the credential stored in Windows Credential Manager has allowed me to login via the command line... The struggle continues.

@ajford
Copy link

ajford commented Sep 16, 2021

I ran into a similar issue on Ubuntu and it ended up being the proxy settings for the service config in /etc/systemd/system/docker.service.d/http-proxy.conf. They were set to an old proxy that didn't exist anymore. I just removed the file (I don't need a proxy anymore) sudo rm /etc/systemd/system/docker.service.d/http-proxy.conf, then did systemctl daemon-reload and systemctl restart docker, and issue was resolved.

This worked for me as well, on Ubuntu 20.04 with Docker version 20.10.8, build 3967b7d

@project-administrator
Copy link

project-administrator commented Sep 24, 2021

This seems to happen on my Debian after I switch my laptop's connection to another network that has a different DNS server (for example if you suspend the laptop and wake it up in another place with another wifi network). Seems that docker "remembers" the DNS from the moment when it has been started. Docker needs to be restarted to start using the new DNS. It does not update its settings automatically on the fly if the system DNS server changes suddenly.

@amastelek
Copy link

Only happens on a local DNS cache - works when changing DNS to 1.1.1.2 or 9.9.9.9

@yoav-sisense
Copy link

clearing the DNS cache did the trick for me on mac

stop docker for mac
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
start docker for mac

@hethcox
Copy link

hethcox commented Feb 17, 2022

clearing the DNS cache did the trick for me on mac

stop docker for mac sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder start docker for mac

This worked for me on Big Sur. Still not sure what the root cause is.

@spunkyduders
Copy link

In my case, I was using the wrong tag name.
Actual tag was abc.azurecr.io/test , but I used
abc.azureacr.io/test instead.

@sonal-511
Copy link

I ran the following command before docker pull and my issue got resolved(was doing in wsl) -

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
sudo docker pull hello-world

@HongLouWang
Copy link

This one looks working now

@wittyquipper
Copy link

Refer to the official documentation https://docs.docker.com/config/daemon/systemd/#httphttps-proxy It helped me since I'm behind an HTTP or HTTPS proxy server

@oopptt
Copy link

oopptt commented Jul 27, 2022

Hi guys,

trying all the workarounds mentioned (etc/hosts, reinstalling, signing out/in, etc.) in my windows 10 and it doesn't work for me :(. I get this error:

Using default tag: latest
Error response from daemon: Get "https://registry-1.docker.io/v2/": unable to connect to 34.231.251.252:443. Do you need an HTTP proxy?

No VPN and no proxy settings in my laptop.

Any other idea? Using v20.10.17 and WSL 2

Thanks in advance!!

@blueband
Copy link

Please, do check if you have not login on Docker Desktop. This error and "Bad response" in my case was resolved by simply login

@Aryankids
Copy link

This worked for me like a charm

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
sudo docker pull hello-world

@MedUnes
Copy link

MedUnes commented Nov 24, 2022

just a hint here: to get the actual up-to-date IP that resolves the SSL endpoint try with:

curl -v  https://registry-1.docker.io/v2/ 
*   Trying 3.216.34.172:443...
(..)

and in your hosts file add that IP (here it is for example 3.216.34.172)

@reinaldo-pinto
Copy link

I am with same error, using docker run.

Ubuntu 20.04.5 LTS
Docker version 20.10.21, build baeda1f

Docker:

╰─> docker run -e GCRCLEANER_LOG=debug -v "${HOME}/.config/gcloud:/.config/gcloud" -it us-docker.pkg.dev/gcr-cleaner/gcr-cleaner/gcr-cleaner-cli 

Error output:

Get "https://gcr.io/v2/": dial tcp: lookup gcr.io on 192.168.15.1:53: no such host

Resolution for me, worked:

docker network create networkexample
docker run --net networkexample -v "${HOME}/.config/gcloud:/.config/gcloud" -it us-docker.pkg.dev/gcr-cleaner/gcr-cleaner/gcr-cleaner-cli

@hackerhandbookk
Copy link

You need to add to your /etc/hosts:

34.228.211.243  registry-1.docker.io

what to insert.... OUR WAN IP or OUR LAN IP?

@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@Asday
Copy link

Asday commented Apr 9, 2023

/remove-lifecycle stale

@Asday
Copy link

Asday commented Apr 9, 2023

The issue persists on Arch with systemd-resolved as of a couple days ago. Workaround is to list cloudflare as my main DNS, which is exceedingly undesirable as you imagine.

@SoleSasia
Copy link

This worked for me like a charm

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null sudo docker pull hello-world

For me too! In Debian 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests