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
git clone https://github.com/seekwhencer/dnswatch.git
This container runs dnsmasq on port 53. Disable the local resolving on port 53:
- 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
- edit the file:
sys/etc/addresses.tmpl
and replace the192.168.178.20
with your own - edit the file:
dnsmasq/dnsmasq.conf
- edit the file:
dnsmasq/d/00-host.conf
cd dnswatch
docker-compose up -d
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