Skip to content

dnsmasq in a docker container, automated with docker-gen, extending jwilder's nginx-proxy automation for qualified urls in a local network.

Notifications You must be signed in to change notification settings

seekwhencer/dnswatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnswatch

  • dnsmasq in a docker container
  • for local network use, not for production
  • extending jwilder's nginx-proxy
  • automate registering of local domains (and subdomains)
  • using nginx-proxy's env parameter VIRTUAL_HOST

get it

git clone https://github.com/seekwhencer/dnswatch.git

configure

This container runs dnsmasq on port 53. Disable the local resolving on port 53:

the host

  • edit this file
sudo nano /etc/systemd/resolved.conf
  • use this
[Resolve]
DNS=192.168.178.20
FallbackDNS=192.168.178.1
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=yes
DNSStubListener=no
#ReadEtcHosts=yes

192.168.178.1 is my local fritz-box internet gateway
192.168.178.20 is the ip of the host machine

  • OR stopping and disabling system-resolved
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved

the container

  • edit the file: sys/etc/addresses.tmpl and replace the 192.168.178.20 with your own
  • edit the file: dnsmasq/dnsmasq.conf
  • edit the file: dnsmasq/d/00-host.conf

start

cd dnswatch
docker-compose up -d

behavior

If a container will be start or stop, the file dnsmasq/d/01-addresses.conf will be written with content like this:

# don't touch this file
# generated by docker-gen
address=/portainer.potemkin/192.168.178.20
address=/brause.potemkin/192.168.178.20

After the file was written, dnsmasq restarts. Together with the reverse proxy you can "mount" a container, mapped on port 80 on a local domain.

On your workstation you have to add this dns server as your preferred one. After this, you can reach your web app locally on a qualified url.

... tested on Ubuntu 20.x.x

About

dnsmasq in a docker container, automated with docker-gen, extending jwilder's nginx-proxy automation for qualified urls in a local network.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published