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
DockerDocker MachineDocker RegistryDocker Problem Overview
I am new to dockers. When I am running the docker pull sonarqube I am getting the following error.
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
Can you please let me know why I am getting the error and how can I rectify this.
Docker Solutions
Solution 1 - Docker
I had similar issue on Ubuntu 16.04
and manage to solve it by adding more nameservers
You can try too.
-
Open config file
sudo nano /etc/resolv.conf
and add the following under existing nameserversnameserver 8.8.8.8
nameserver 8.8.4.4
-
run following commands to restart daemon and docker service
sudo systemctl daemon-reload
sudo systemctl restart docker
Now try to pull image you want docker pull sonarqube
Solution 2 - Docker
In my case on a Mac, only a restart of the docker-machine did the work:
docker-machine restart
Uninstalling docker did not work! Just the above restart is enough!
Solution 3 - Docker
I was able to resolve by running the below command.
sudo systemctl restart docker
Solution 4 - Docker
sudo vi /etc/resolv.conf
And change nameserver to 8.8.8.8
Solution 5 - Docker
I had the same issue, for me I was behind my office proxy and docker was not picking up the proxy set for terminal. To fix this, i have to set the proxy in docker settings window, which can be accessed from
Solution 6 - Docker
I was able to solve this issue, by logging into docker.
sudo docker login
Enter your login credentials
sudo docker pull 'yourImageName'
Solution 7 - Docker
in windows, just restart the docker, it worked for me. Go to Docker Desktop dashboard, click on the icon with setting icon and click restart
Solution 8 - Docker
This could also be a DNS issue. Altering your nameservers will most likely resolve it, if is indeed related to your DNS.
You can verify the issue with: curl -vvv https://registry-1.docker.io/v2/
for a more detailed path.
If you are on ubuntu 18.04 or higher /etc/resolve.conf
won't do the trick, they moved network management to NetPlan configs.
Add the google nameservers to your configuration (8.8.8.8 and 8.8.4.4)
find your network adapter name with ip a
network:
version: 2
renderer: NetworkManager
ethernets:
[network adapter name]:
addresses: ...
gateway4: ...
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
search: []
And run sudo netplan apply
Solution 9 - Docker
Disable experiment features and try again does the trick. Otherwise add the config below to daemon.json
"dns": [
"8.8.8.8",
"8.8.4.4"
]
Solution 10 - Docker
If your machine are located within the Great China area or using related Virtual Server, add Registry Mirrors
to help your bypass the complex network router.
Or your can set a http_proxy for your docker configuration, referencing this link: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
Solution 11 - Docker
It happens when you are not logged in too, it happened to me. Problem gone after I logged in
Solution 12 - Docker
You need to add to your /etc/hosts in terminal write
$ sudo nano /etc/hosts
add below line and save it, try to run command and it will be working
34.228.211.243 registry-1.docker.io
Solution 13 - Docker
I just restarted and it works fine again!
Solution 14 - Docker
Things that might work:
- Check your proxy settings
- Restart docker
- Go to your docker settings and check if you're signed in to docker hub, if you aren't, sign in and try again (This worked for me)
Solution 15 - Docker
make sure that your server is not located in the following areas:
> Docker is a US company, we must comply with US export control regulations. In an effort to comply with these, we now block all IP addresses that are located in Cuba, Iran, North Korea, Republic of Crimea, Sudan, and Syria.
Solution 16 - Docker
A restart of your internet connection might solve this.
Solution 17 - Docker
In China, Add 114.114.114.114 to resolv.conf fixed it. sudo echo "nameserver 114.114.114.114" >> /etc/resolv.conf
Solution 18 - Docker
I was getting the same error. Tried a few things like restarting the server, checking configuration etc... Finally, it got resolved by adding proxies (since I was using it inside my organization network)
Solution 19 - Docker
Had same issue, I restarted docker and it worked
Solution 20 - Docker
I got the same error & I solved it by executing the below-mentioned commands, If you are working on the windows version, you can try these commands Steps to be followed : Open the command prompt & execute these commands,
set http_proxy="http://user:[email protected]:port"
set https_proxy="https://user:[email protected]:port"
Solution 21 - Docker
I had the same problem, for me it was ACR repository name that I have misspelled. Maybe check your variables. I used it within Github Actions in the secret sections.
Solution 22 - Docker
I had this same issue with a different solution. The issue was that the internet wasn't connected. That's another thing to check if none of these fix it for you!
Solution 23 - Docker
My issue was tha ti was behind a corporate proxy and hence i was unable to reach the registry-1.docker.io.
Solution:
I bypassed this URL registry-1.docker.io in the proxy server for following
- SSL bypass
- Authentication Bypass.
Then i configured the proxy settings in docker.service file in RHEL server as
Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=http://proxy.example.com:443"
NO_PROXY=“tnd-harbor.india.airtel.itm,10.241.99.232,
registry-1.docker.io/v2/”
Make sure the HTTPS_PROXY protocol is http.
By doing this i was able to fetch images.
Solution 24 - Docker
Executing docker as root fixed this for me. Like this: sudo docker pull foo/bar