Skip to content
Sign inDashboard

Install with Docker

The image is ghcr.io/operomtl/opdns-node, for linux/amd64 and linux/arm64. It contains the static node binary and Alpine’s Unbound, which the node starts and supervises. It runs as an unprivileged user that can bind port 53. Data lives in the volume at /var/lib/opdns.

Each release gets a tag with its version (v1.2.3), and that tag never moves. v1.2 and v1 follow the newest release of that line. latest follows the newest stable release. Pre-releases, such as v1.3.0-rc1, move none of these tags. For anything important, pin a version or a digest.

The linux/amd64 image is about 35 MB compressed (86 MB unpacked).

On many Linux distributions, systemd-resolved listens on 127.0.0.53:53. This conflicts with publishing port 53 on all addresses. Publish on the LAN address only (-p 192.168.1.10:53:53/udp), or turn off the stub listener of systemd-resolved:

/etc/systemd/resolved.conf.d/no-stub.conf
[Resolve]
DNSStubListener=no

Then run sudo systemctl restart systemd-resolved.

If another program still uses port 53, the node refuses to start. When the node can see that program (a binary install, or a container on the host network), its log names it, for example dnsmasq (pid 733) holds port 53/tcp. The log also gives the fix for that program. For dnsmasq, port=0 in its configuration keeps its DHCP and turns off its DNS. You must stop another Pi-hole or DNS server, or move it to another address. On the host, sudo ss -lunpt 'sport = :53' shows the same information.

The Nodes → Add a node dialog in the dashboard shows this command, with your enrollment code filled in. See Enroll a node.

Terminal window
docker run -d --name opdns-node --restart unless-stopped --read-only \
-p 53:53/udp -p 53:53/tcp \
-p 127.0.0.1:8053:8053 \
-v opdns-node:/var/lib/opdns \
-e OPDNS_ENROL_TOKEN=<enrolment-code> \
ghcr.io/operomtl/opdns-node:<version>

The node needs the real source address of each client. It names devices by that address and records it in the query log. Its open-resolver guard (the filter that refuses queries from outside your network) answers only LAN sources.

  • Host networking (network_mode: host, docker run --network host) is the recommended mode. The node sees every source address, IPv4 and IPv6. It also sees its own interfaces, which the IPv6 egress test needs. Port 53 must be free on the host. With host networking, set OPDNS_PAGE_ADDR=127.0.0.1:8053, as the Compose file does. If you do not, the status page is on the LAN.
  • Bridge networking with published ports (-p 53:53/udp, the docker run line in the dashboard) keeps the source address only while Docker forwards with iptables DNAT (rootful Docker on Linux, IPv4). Sometimes the userland proxy of Docker forwards instead: IPv6 without ip6tables, rootless Docker or Podman, and Docker Desktop on macOS and Windows. Then every query arrives from the bridge gateway (172.17.0.1). All devices become one client, and the query log shows that address. The guard admits everything, because that gateway is a private address. To test, query the node from a LAN device. Then look at the client address of that query in the query log of the dashboard. If it is the gateway, switch to host networking.
  • macvlan gives the container its own address on the LAN. The node then sees source addresses as with host networking, and port 53 on the host stays with another program (systemd-resolved, or a Pi-hole that you are replacing). Use the Compose file below. The host itself cannot reach a macvlan container over that interface.

For macvlan, save this as compose.macvlan.yaml. Set the parent interface, the subnet, the gateway and the address of the node for your network:

compose.macvlan.yaml
# opdns-node with Docker Compose on a macvlan network: the node gets its
# own address on the LAN, so it sees every client's real source address
# and port 53 on the host can stay with another program.
#
# OPDNS_ENROL_TOKEN=<code> OPDNS_LAN_IF=eth0 OPDNS_LAN_SUBNET=192.168.1.0/24 \
# OPDNS_LAN_GATEWAY=192.168.1.1 OPDNS_NODE_ADDR=192.168.1.53 \
# docker compose -f compose.macvlan.yaml up -d
#
# Pick OPDNS_NODE_ADDR outside the router's DHCP pool, and point the
# router's DHCP DNS server at it. A macvlan container cannot talk to its own
# host over that interface (a kernel rule): the host itself resolves through
# something else, or through a macvlan sub-interface on the host. The
# status page listens on the node's address (port 8053), open to the LAN
# sources its allowlist admits: set a page password.
services:
opdns-node:
image: ghcr.io/operomtl/opdns-node:${OPDNS_NODE_TAG:-latest}
restart: unless-stopped
read_only: true
cap_drop: [ALL]
cap_add: [NET_BIND_SERVICE]
networks:
lan:
ipv4_address: ${OPDNS_NODE_ADDR:-192.168.1.53}
volumes:
- opdns-node:/var/lib/opdns
environment:
OPDNS_ENROL_TOKEN: ${OPDNS_ENROL_TOKEN:-}
OPDNS_IMAGE: ghcr.io/operomtl/opdns-node:${OPDNS_NODE_TAG:-latest}
networks:
lan:
driver: macvlan
driver_opts:
parent: ${OPDNS_LAN_IF:-eth0}
ipam:
config:
- subnet: ${OPDNS_LAN_SUBNET:-192.168.1.0/24}
gateway: ${OPDNS_LAN_GATEWAY:-192.168.1.1}
volumes:
opdns-node:

With macvlan the status page is on the LAN: set a page password.

The status page and /api/status (versions.image) show OPDNS_IMAGE. Set it to the image that you run, preferably with its digest (ghcr.io/operomtl/opdns-node:v1.2.3@sha256:…). A container cannot read the digest of its own image.

The node installs a list artifact (the signed file of filter lists) only if its Ed25519 signature verifies. You do not have to configure the key. By default (lists.trust_cloud_key: true), an enrolled node learns the key from the cloud on every profile pull. It keeps the key in lists_keys.json in the volume. After a restart, it can then verify lists without the internet. To pin keys yourself instead, set OPDNS_LISTS_PUBLIC_KEYS and OPDNS_LISTS_TRUST_CLOUD_KEY=false (list signing keys).

The node uses OPDNS_ENROL_TOKEN once, on first start. After that, the identity of the node is in the volume, and the node ignores the variable. You can safely leave it in the Compose file. The code works only once and expires after 15 minutes.

A container does not serve DNS if it has no enrollment code, no existing identity in its volume and no standalone profile. It prints how to enroll and exits with status 2. With --restart unless-stopped, it keeps restarting and printing the same message until you add the code.

  1. Run docker logs opdns-node. It shows the enrollment and “loaded” lines.
  2. Run docker exec opdns-node opdns-node status. It prints the mode, the node id, the profile, the link state and the versions.
  3. On the host, open http://127.0.0.1:8053/ for the status page.
  4. Run dig @<host-address> example.com. It gets an answer.
  5. Open the Nodes page in the dashboard. It shows the node online.

The image has a health check on /healthz. When Unbound answers and a profile and lists are loaded, docker ps shows the container as healthy.

Set the DHCP DNS server of your router (option 6) to the LAN address of the node. If you use IPv6, also set IPv6 RDNSS. Queries from every device then go to the node.

By default, the node listens for plain DNS. For DNS-over-TLS, DoH, DoQ or DoH3 on your LAN, give it a certificate for a name that your devices use. Then set the listeners, for example:

compose.yaml (excerpt)
ports:
- "853:853/tcp"
- "443:443/tcp"
volumes:
- opdns-node:/var/lib/opdns
- /etc/letsencrypt/live/dns.home.example:/certs:ro
environment:
OPDNS_LISTEN_DOT: ":853"
OPDNS_LISTEN_DOH: ":443"
OPDNS_LISTEN_TLS_CERT: /certs/fullchain.pem
OPDNS_LISTEN_TLS_KEY: /certs/privkey.pem
OPDNS_LISTEN_DNS_DOMAIN: dns.home.example

A certificate renewal needs no restart. Every second, the node reads the certificate and key files. When the pair changes, the node loads the new pair at once. If a pair fails to load, the node logs it and keeps the previous certificate. Connections that are already open keep the certificate that they started with. docker kill -s HUP opdns-node forces a reload. It also pulls the profile and lists again and applies the reloadable configuration keys. The log says certificate reloaded, with the new expiry date.

Every key is on the configuration reference.