Sign inSign up

havenodex/dnsmasq

By havenodex

•Updated about 2 years ago

A dockerized version of the popular dnsmask adapted for use within the Haveno Ecosystem

Image
0

414

havenodex/dnsmasq repository overview

⁠dnsmasq

A lightweight dnsmasq Docker container.

⁠Overview

dnsmasq is a lightweight DNS forwarder, cache, and DHCP server. In this container, allowing easy configuration and control of dnsmasq via a browser interface.

This container allows you to:

  • Serve DNS requests on any network.
  • Customize DNS configurations through a user-friendly web interface.
  • Manage and edit DNS settings in real-time.
  • Log and analyze DNS queries.

⁠Features

  • Real-time logging: Monitor and manage DNS queries and DNS resolution directly from the interface.

⁠How to Use

⁠Step 1: Create the Configuration File

First, create a dnsmasq.conf file on your Docker host. For example, place it at /opt/dnsmasq.conf. A sample configuration might look like this:

# Log all DNS queries
log-queries

# Use only specified DNS servers (Cloudflare in this example)
no-resolv
server=1.1.1.1
server=1.0.0.1
strict-order

# Serve all .onion domains through Tor DNS port
server=/onion/127.0.0.1:9053

# Define static IP for specific hosts
address=/myhost.company/10.0.0.2

For a more detailed configuration file, refer to the official dnsmasq documentation: dnsmasq.conf⁠.

⁠Step 2: Run the Container

Run the following command to start 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 always \
   havenodex/dnsmasq
  • Ports:
    • 53: Standard DNS port (UDP).
⁠Step 3: Test DNS Resolution

To verify that your dnsmasq server is working, run a query from another machine, replacing <docker-host> with the IP address or hostname of your Docker host:

$ host myhost.company <docker-host>
Using domain server:
Name: <docker-host>
Address: <docker-host>#53
Aliases:

myhost.company has address 10.0.0.2
⁠Docker Compose Usage

You can easily set up dnsmasq using Docker Compose. Create a docker-compose.yml file with the following content:

version: '3'
services:
  dnsmasq:
    image: havenodex/dnsmasq
    ports:
      - "53:53/udp"
      - "5380:8080"
    volumes:
      - /opt/dnsmasq.conf:/etc/dnsmasq.conf
    restart: always
    logging:
      options:
        max-size: "100m"
⁠How to Use
  1. Create the dnsmasq.conf file as described in the Configuration section and place it at /opt/dnsmasq.conf on your host.

  2. Run the container using Docker Compose:

$ docker-compose up -d
  1. To stop the container, run:
docker-compose down

⁠License

This project is licensed under the MIT License.


Contributors: Author: https://github.com/jpillora/webproc⁠ (J Pillora) Maintainer: https://kewbit.org⁠` (Kewbit)

Tag summary

Content type

Image

Digest

sha256:1c9c9af9a…

Size

6.4 MB

Last updated

about 2 years ago

docker pull havenodex/dnsmasq