docker-mini-dns
v1.0.6
Published
Runs a tiny A-Record DNS server that lets you get to docker containers by hostname
Downloads
12
Readme
docker-mini-dns server
This package fires up a tiny DNS server whose sole purpose is to listen for DNS lookups and try to resolve by matching running container names.
This is specifically for docker native on OSX, where everything is a port on localhost.
How it works:
- DNS query for a docker image *.docker comes in (e.g., you browse to
http://example.docker:9000
) - Server tests against
docker ps
to try to match the name and returns 127.0.0.1 if successful
Setup
sudo mkdir /etc/resolver
sudo touch /etc/resolver/docker && chown $USER /etc/resolver/docker
docker-mini-dns &
./restart_mdns.sh
-- this is apparently needed to flush the DNS cache on 10.11 and higher