Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Docker DNS-gen (previously: Docker dns-gen)

Why I forked this repository: the container should be build regularly and for all local and running containers should be a DNS entry created. Not only for exposed one

License: GitHub
Github Workflow Build: GitHub Workflow Status
Docker Build Status: Docker Build Status
Docker Automated build: Docker Automated build
Docker Pulls Docker Pulls
Docker latest tag: Docker Image Version (tag latest semver)
Image size tag: latest Docker Image Size (tag)

dns-gen sets up a container running Dnsmasq and [docker-gen]. docker-gen generates a configuration for Dnsmasq and reloads it when containers are started and stopped.

By default it will provide thoses domain:

  • container_name.docker
  • container_name.network_name.docker
  • docker-composer_service.docker-composer_project.docker
  • docker-composer_service.docker-composer_project.network_name.docker

How it works

The container dns-gen expose a standard dnsmasq service. It returns ip of known container and fallback to host's resolv.conf for other domains.

Fork

The rest of the upstream README has been removed here, but can still be found at the upstream repository.

This fork does only one:

  • For EVERY (its not important if it is public or not) container it creates an dnsmasq entry and removed it when the container die.

Nothing more.

Running

To start the container, a command like the following can be used. Additionally, --restart always can be added to have the container start automatically when your machine is restarted.

docker run -d --name dns-gen -v /var/run/docker.sock:/var/run/docker.sock 8ear/secure-dns-gen

Compose-only mode

By default, dns-gen creates records for every running container. Set COMPOSE_ONLY=true to create records only for regular Docker Compose services:

docker run -d \
  --name dns-gen \
  --env COMPOSE_ONLY=true \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  8ear/secure-dns-gen

Compose services are identified by the runtime label com.docker.compose.oneoff=False. This excludes plain docker run containers and containers started by docker compose run.

To include a non-Compose or one-off container while compose-only mode is enabled, add the dns.include=true label:

docker run --label dns.include=true ...

All other commands etc. you can read from the upstream repository.

About

DNS Server for docker

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages