Technitium DNS Server in Docker: Install and Configure
This tutorial shows how to run Technitium DNS Server in Docker on your Ubuntu VM (e.g. 112-Technitium-DNS_Server at 172.100.12.112). After this, you’ll use it as your primary DNS and configure your router so all devices get DNS via DHCP.
What is Technitium DNS Server?
Technitium DNS Server is a free, open-source DNS server with a web UI. It can:
- Resolve and cache DNS for your whole network.
- Block ads and malware (optional).
- Support DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT).
- Store config in a folder so it survives container restarts.
We run it in Docker so updates and backups are simple.
Where This Fits
flowchart LR
A[VM + Docker] --> B[This tutorial]
B --> C[Technitium in Docker]
C --> D[Primary DNS and router]
- Before: Docker and Docker Compose are installed on the VM.
- After: Technitium is running in Docker with a persistent config. Next: set it as primary DNS and configure the router.
Step 1: Free Port 53 (Ubuntu)
Technitium needs port 53 for DNS. On Ubuntu 24, systemd-resolved often uses it. Disable it for the main interface so Technitium can bind to 53:
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolvedPoint the host to a public resolver so it can still resolve names (optional; only until Technitium is up). Edit /etc/resolv.conf (often managed by resolvconf):
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf(After Technitium is running, you can point the host to 127.0.0.1 if you prefer.)
Step 2: Create Folders for Config and Data
mkdir -p ~/technitium/config ~/technitium/logs
cd ~/technitiumStep 3: Docker Compose for Technitium
Create docker-compose.yml in ~/technitium:
services:
technitium:
image: technitium/dns-server:latest
container_name: technitium-dns
restart: unless-stopped
ports:
- "53:53/udp"
- "53:53/tcp"
- "5380:5380"
volumes:
- ./config:/etc/dns
- ./logs:/var/log/dns
environment:
- DNS_SERVER_PREFER_IPV6=false
cap_add:
- NET_ADMIN- 53: DNS (UDP/TCP).
- 5380: Web console (HTTP). Use
http://172.100.12.112:5380from your browser (replace with your VM IP). - config: Persists Technitium settings.
- logs: Persists logs.
Optional: set an admin password and domain on first run (only when config is empty). Add under environment:
- DNS_SERVER_ADMIN_PASSWORD=your-secure-password
- DNS_SERVER_DOMAIN=homeStep 4: Start Technitium
cd ~/technitium
docker compose up -d
docker compose psCheck that the container is running and that port 53 is listening:
ss -ulnp | grep 53Step 5: Open the Web Console
- In your browser go to: http://172.100.12.112:5380 (use your VM IP if different).
- First time: set an admin password and optional domain if prompted.
- You can now create zones, enable blocking, and tweak settings from the UI.
Step 6: Quick Test from Another Machine
Point another device (or your router) to 172.100.12.112 as DNS and run:
nslookup google.com 172.100.12.112You should get a reply from Technitium.
Reference: Useful Links
- Technitium DNS Server — official site.
- Docker Hub: technitium/dns-server — image and docs.
- Technitium GitHub — source and Docker env vars.
What’s Next?
| Step | Tutorial | What you’ll do |
|---|---|---|
| 1 | Create VM | VM with static IP |
| 2 | Docker and utilities | Docker + Compose + tools |
| 3 | You are here | Technitium in Docker |
| 4 | Technitium primary DNS and router | Primary DNS on VM; router DHCP so all devices use Technitium |