Todd Matthews
Todd Matthews

Reputation: 291

Docker DNS Error

I'm new to docker and networking. Im trying to set up a Docker container and im getting a DNS error and i have no idea where to start to resolve it.

im using this command

sudo docker run -name mysql -d sameersbn/mysql:latest

im getting this error

Get https://index.docker.io/v1/repositories/sameersbn/mysql/
images: dial tcp: lookup index.docker.io: no DNS servers

any help would be appreciated. Im running this from a server that im connect to over the network, so i internet connection and in my etc/defualt/docker file i do have the dns name servers 8.8.8.8 & 8.8.4.4

Upvotes: 2

Views: 1075

Answers (2)

X99
X99

Reputation: 915

Use --network host in the command-line. Or use a docker-compose file with this option.

Upvotes: 0

Sreedhar GS
Sreedhar GS

Reputation: 2788

open command window,

ping registry-1.docker.io

copy the ip address and it to

C:\Windows\System32\drivers\etc\hosts file

cdn-registry-1.docker.io <ip_address>

Restart the docker application

  1. Execute "Delete Boot2Docker VM" application

  2. Execute "Boot2Docker Start"

Hope this should solve the problem

Upvotes: 1

Related Questions