Giter Club home page Giter Club logo

docker-dnsmasq's Introduction

docker-dnsmasq

This is a fork of jpillora/docker-dnsmasq to extend for arm32, arm64 architecture.

This project:

dnsmasq in a docker container

dnsmasq in a docker container, configurable via a simple web UI

Docker image platform / architecture

The Docker image to use joweisberg/glances:latest. Build on Linux Ubuntu 20.04 LTS, Docker 19.03 and above for:

Platform Architecture / Tags
x86_64 amd64
aarch64 arm64
arm arm32

Docker

Get the container:

$ docker pull joweisberg/glances:latest

Usage

  1. Create a /opt/dnsmasq.conf file on the Docker host

    #dnsmasq config, for a complete example, see:
    #  http://oss.segetech.com/intra/srv/dnsmasq.conf
    #log all dns queries
    log-queries
    #dont use hosts nameservers
    no-resolv
    #use cloudflare as default nameservers, prefer 1^4
    server=1.0.0.1
    server=1.1.1.1
    strict-order
    #serve all .company queries using a specific nameserver
    server=/company/10.0.0.1
    #explicitly define host-ip mappings
    address=/myhost.company/10.0.0.2
  2. Run the container

    $ docker run \
    	--name dnsmasq \
    	-d \
    	-p 53:53/udp \
    	-p 5380:8080 \
    	-v /opt/dnsmasq.conf:/etc/dnsmasq.conf \
    	--log-opt "max-size=100m" \
    	-e "HTTP_USER=foo" \
    	-e "HTTP_PASS=bar" \
    	--restart unless-stopped \
    	joweisberg/dnsmasq
    
  3. Run the container via docker-compose

    dnsmasq:
     container_name: dnsmasq
     image: joweisberg/dnsmasq:latest
     volumes:
       - /opt/dnsmasq.conf:/etc/dnsmasq.conf
     restart: unless-stopped
     ports:
       - 53:53/udp
       - 5380:8080
  4. Visit http://<docker-host>:5380, authenticate with foo/bar and you should see

    screen shot 2017-10-15 at 1 41 21 am
  5. Test it out with

    $ host myhost.company <docker-host>
    Using domain server:
    Name: <docker-host>
    Address: <docker-host>#53
    Aliases:
    
    myhost.company has address 10.0.0.2
  6. Run the following commands to disable the localhost resolved service

     sudo systemctl disable systemd-resolved
     sudo systemctl stop systemd-resolved
     sudo rm /etc/resolv.conf
     echo "nameserver 8.8.8.8" > /etc/resolv.conf

docker-dnsmasq's People

Contributors

joweisberg avatar

Watchers

 avatar  avatar

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.