Sign inSign up

zedmanny/dhcpd3-dns

By zedmanny

•Updated 3 months ago

Image
0

1.2K

zedmanny/dhcpd3-dns repository overview

⁠dhcpd3-dns

A combined DHCP + DNS appliance with a web UI. Multi-interface ISC dhcpd (one DHCP scope per VLAN) plus a dnsmasq DNS server (recursive resolution + local/forward zones). Runs anywhere containers do — Linux host, VM, or an edge/container platform (EVE-OS).

Image: zedmanny/dhcpd3-dns:latest (multi-arch: amd64 + arm64)

⁠What it does

  1. Serves DHCP to one or more VLANs — one scope per interface.
  2. Serves DNS — resolves recursively via upstreams by default; add your own authoritative or conditional-forward zones.
  3. Web UI on port 8080 — edit DHCP scopes, reservations, DNS zones; view leases and live DHCP + DNS topology.
  4. Self-configures from environment variables so it serves on first boot.

Ports: DHCP 67/udp, DNS 53/udp+53/tcp, web UI 8080/tcp. State (config + leases) persists in /data.

⁠Web UI

Open http://<container-ip>:8080.

TabPurpose
Global / Subnetsedit DHCP scopes (broadcast auto-fills from the netmask)
Reservationsstatic host → MAC → IP
Leasesactive DHCP leases
Topologycontainer → interfaces → VLAN clouds → leased devices
DNSrecursive upstreams + zones (authoritative records or conditional forward)
DNS Topologythis box as DNS server → clouds → upstream DNS servers
dhcpd.confrendered DHCP config

⁠DHCP configuration (environment)

Single interface: STATIC_IP, STATIC_GW, DHCP_SUBNET, DHCP_NETMASK, DHCP_RANGE_START, DHCP_RANGE_END, DHCP_GATEWAY, DHCP_DNS, DHCP_FORCE_SEED.

Multiple interfaces (one VLAN/scope per NIC), indexed NET1_*, NET2_*, … (1–8):

VarNotes
NET{i}_IFACEinterface (default eth{i-1})
NET{i}_IPIP with prefix — subnet/netmask/broadcast derived
NET{i}_RANGE_START / NET{i}_RANGE_ENDpool
NET{i}_GATEWAYgateway handed to clients
NET{i}_DNS / NET{i}_NTPCSV (set NET{i}_DNS to this container's IP to use it for DNS)
NET{i}_DOMAINoptional

⁠DNS configuration

  • Default (recursive) zone — anything not matched by a zone resolves through the upstreams in DNS_RECURSIVE (CSV, default 1.1.1.1,8.8.8.8), or set them in the DNS tab.
  • Authoritative zone — a local domain with records (A / AAAA / CNAME / TXT / MX).
  • Forward zone — send a domain's queries to specific upstream servers.

Zones are managed in the UI and persist in /data/dns.json.

DNS_RECURSIVE vs NET{i}_DNS — don't confuse them:

  • DNS_RECURSIVE is global (one setting) — the upstreams this container forwards to for recursive resolution.
  • NET{i}_DNS is per VLAN — the DNS server address handed to that VLAN's DHCP clients (set it to this container's IP on that VLAN to use it as their resolver). It's a DHCP option, not the resolver's upstream.

⁠Web UI auth

VarNotes
USER_NAMElogin user (default admin)
USER_PASSSHA-256 hex hash of the password; set to require login
WEBUI_USER / WEBUI_PASSWORDplaintext fallback

Generate a hash: printf '%s' 'yourpassword' | openssl dgst -sha256 | awk '{print $NF}'

⁠Networking

DHCP and DNS need Layer-2 access to the segments they serve — put the container directly on each VLAN (host networking / macvlan, or a Switch NI with access_vlan_id on EVE-OS). Needs NET_ADMIN / NET_RAW.

⁠Example — two VLANs (Docker)

docker run -d --name dhcpd3-dns --network host \
  --cap-add NET_ADMIN --cap-add NET_RAW -v dhcpd3-dns-data:/data \
  -e NET1_IFACE=eth0 -e NET1_IP=192.168.254.100/24 \
  -e NET1_RANGE_START=192.168.254.150 -e NET1_RANGE_END=192.168.254.200 \
  -e NET1_GATEWAY=192.168.254.1 -e NET1_DNS=192.168.254.100 \
  -e NET2_IFACE=eth1 -e NET2_IP=192.168.255.100/24 \
  -e NET2_RANGE_START=192.168.255.150 -e NET2_RANGE_END=192.168.255.200 \
  -e NET2_GATEWAY=192.168.255.1 -e NET2_DNS=192.168.255.100 \
  -e DNS_RECURSIVE=1.1.1.1,8.8.8.8 \
  zedmanny/dhcpd3-dns:latest

On EVE-OS, deliver the same vars via the app's cloud-init runcmd, give the app one interface per VLAN (each with its access_vlan_id), and mount a volume at /data.

⁠API

MethodPathPurpose
GET/PUT/api/configDHCP config
PUT/api/reservationsreservations
GET/api/leasesactive leases
GET/api/topologyDHCP topology
GET/PUT/api/dnsDNS config
POST/api/dns/validatednsmasq --test dry-run
GET/api/dns/topologyDNS topology
GET/api/service/statusRUNNING / STOPPED
GET/api/docsOpenAPI / Swagger UI

Tag summary

Content type

Image

Digest

sha256:742566f0c…

Size

75.8 MB

Last updated

3 months ago

docker pull zedmanny/dhcpd3-dns