dial tcp: lookup xxx.xxx.xxx.xxx: no such host
90,518
Solution 1
Editing the DNS nameserver in /etc/resolv.conf
file helped me.
Change your existing nameserver to google nameserver i.e., x.x.x.x to 8.8.8.8
Comment your nameserver IP and add something like this :
#nameserver x.x.x.x
nameserver 8.8.8.8
should work.
Solution 2
If you are behind a proxy, this could be your issue. In this case, you need to configure the Docker daemon (not the client) proxy settings. You can do that by:
- Create a systemd drop-in directory for the docker service:
sudo mkdir -p /etc/systemd/system/docker.service.d
- Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service] Environment="HTTP_PROXY=http://proxy.example.com:80/"
- Flush changes
sudo systemctl daemon-reload
- Restart docker daemon
sudo systemctl restart docker
Reference: Docker documentation.
Related videos on Youtube
Author by
pavan
Updated on March 27, 2022Comments
-
pavan about 2 years
Trying to push an docker image to private docker repository. but getting error like:
"dial tcp: lookup xxx.xxx.xxx.xxx: no such host"
. I have logged in correctly to the repository and build succeeded.The following command using to push the image to private
repo: sud docker push x.x.x.x:446/dns/graphs
-
triple.vee almost 4 yearsThat did indeed work...thank you. Any idea why Google Cloud Shell is configured with a different nameserver than 8.8.8.8? The nameserver that is configured in resolve.conf by default is unreachable.
-
Enrique René about 3 yearsIntroduction to Google Public DNS: developers.google.com/speed/public-dns/docs/intro
-
Nasser Abdou almost 2 yearsI had this issue when creating a cluster on kubernetes and know it's resolved with this answer.