Fixing Docker Temporary Failure In Name Resolution When Pulling Images
Yeah, Can you fix it now? ??, I have these personal servers, After I login to the server and decided to pull an image, I was having this error:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
The first thing I did was pinging google.com to see, If I have any network issue or so. And everything was fine, I also tried adding a DNS to the docker daemon which didn't worked out, So I tried another server on same network with a different distro, The first one was running CentOS and the second one was running Ubuntu, Same error, But in one of the error I encountered in one of the server when pulling the image was cloudflare related issue cant' remember, I came across a solution that said I should add a Google DNS server to resolv.conf, Then I remembered there was a new DNS entry to our corporate network, Then I checked it, The DNS was there, I removed it and trying pulling with Cloudflare 1.1.1.1 and still error persists, I removed it and added Google DNS 8.8.8.8 which fixed the error.
How To Fix The Error
Login in to your server
vim /etc/resolv.conf And Add this nameserver 8.8.8.8
And save, Now trying pulling the image, You should be fine.