Docker – dial tcp: lookup no such host – Solution


While using Docker a user is unable to perform tasks such as pull new image or search for new images while the following error message appears:

# docker pull debian:8
Pulling repository debian
FATA[0053] Get dial tcp: lookup no such host


While this is a randomly occurring error it is frequently linked to a DNS resolution query by docker services. First, make sure you are running up to date docker installation. If this does not resolve your issue then try to resolve this error by restarting your docker service:

# service docker restart
Redirecting to /bin/systemctl restart  docker.service

In case that you are unable to restart your docker service at a present time you my try to temporarily resolve this issue by including the IP address of the host in question eg. to your /etc/hosts file. Resolve the IP address:

# dig +noall +answer +nocomments

; <<>> DiG 9.9.4-P2-RedHat-9.9.4-18.P2.fc20 <<>> +noall +answer +nocomments
;; global options: +cmd        30      IN      A

Next, include the IP address to your system’s /etc/hosts file:

# echo '' >> /etc/hosts