This is a containerized DNS server that pulls the configuration from a Git repository. The container is based on dnsmasq, which uses a hosts file for generating DNS records. My use cases for this are:
- Providing memorable URLs for services running in a home VPN.
- Resolving web URLs for local development, such as
*.dev.mydomain.priv
.
There are two ways to provide DNS records:
- Pass environment variable
GIT_PATH
containing the full path to the Git repository. - Mount a folder containing a file called
hosts
as/srv
in the container.
There are several lifetime scripts provided in the scripts
directory:
build
- only build the containertest
- run the test setupstart
- start the container in the background without buildingstop
- remove the containerrestart
-stop
, thenstart
Depending on your Docker setup, you might have to run them as sudo.