iverberk / docker-spy

A tiny local development DNS server that dynamically updates DNS records based on Docker container events.
53 stars 20 forks source link

Unable to ping docker container from host #6

Open alexgkt opened 9 years ago

alexgkt commented 9 years ago

Hi there,

I've setup docker_spy as per instructions stated on readme and have no issue with containers recognizing one another through either the defined hostname or container name.

Is there any additional steps needed other than just adding the docker0 ip as nameserver on /etc/resolv.conf?

I noticed pinging the containers from one another will produce an entry in docker logs either stating forwarding to external recursor or internal record found but trying to ping the container hostname from the host doesn't seems to produce any entries in the logs.

JurrianFahner commented 9 years ago

If you want to ping from the host to the container, you need to add the nameserver of Docker to your nameserver configuration. Under ubuntu you create /etc/resolvconf/resolv.conf.d/tail. In this file you put the following: nameserver 172.17.42.1 After running "sudo resolvconf -u" you should be able to ping from host to container.