Skip to content
/ dons Public

Look up docker container ip addresses using dns.

Notifications You must be signed in to change notification settings

heyLu/dons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dons

Resolve <container-id>.docker.local to the ip of that container via DNS.

usage

$ ./dons
running server on 127.0.0.1:8053
# somewhere else ...
$ dig @127.0.0.1 -p 8053 53a98c2ac.docker.local
[...]
;; ANSWER SECTION:
53a98c2ac.docker.local. 0       IN      A       172.17.0.11

To use it directly, you have to run it as ./dons 127.0.0.1:53 and configure it as your DNS server:

# /etc/resolv.conf
nameserver 127.0.0.1

However, you need root privileges to do that, so you might want to install dnsmasq and configure it as follows in addition to the above:

# /etc/dnsmasq.conf
server=/docker.local/127.0.0.1#8053

The you can run ./dons as a regular user.

installation

Use a binary release, or build it yourself using go get . && go build.

If you want to install it permanently and have dnsmasq installed, run sudo make install.

To make it work with NetworkManager, add dns=dnsmasq to your config, as described on the arch wiki and systemctl disable dnsmasq.service, because NetworkManager will start it.

About

Look up docker container ip addresses using dns.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages