Coder Social home page Coder Social logo

seekwhencer / dnswatch Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

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

Dockerfile 72.11% Shell 27.89%
docker docker-gen dns dnsmasq docker-compose nginx-proxy

dnswatch's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.