Set up local DNS with AdGuard Home on Debian 13
AdGuard Home resolves domain names and can filter ads and trackers at the DNS level.
On Debian 13, Docker Compose exposes DNS on the LAN. The admin interface opens through an SSH tunnel.
Create home.arpa names, test them on one client, then advertise the resolver through your router’s DHCP.
Prepare the VM and check the DNS port
Reserve a stable address for the Debian VM. This example uses 192.168.10.53. Check whether a service already listens on port 53 of that address or on all interfaces.
Terminalip -br address sudo ss -lntup '( sport = :53 or sport = :3000 )' mkdir -p ~/adguard-home && cd ~/adguard-homeA resolver listening only on 127.0.0.53 can coexist with this setup. If dnsmasq or Unbound owns the LAN address, adjust its bind address or use a dedicated VM.
Deploy the container
Create a .env file containing LAN_IP=192.168.10.53 and adjust the address for your VM. Save the following block to compose.yaml.
compose.yamlservices: adguard: image: adguard/adguardhome:latest restart: unless-stopped ports: - "${LAN_IP:?Set LAN_IP in .env}:53:53/tcp" - "${LAN_IP:?Set LAN_IP in .env}:53:53/udp" - "127.0.0.1:3000:3000/tcp" volumes: - ./conf:/opt/adguardhome/conf - ./work:/opt/adguardhome/workOn the router or inter-VLAN firewall, allow TCP and UDP port 53 to the VM only from the intended client networks. Keep WAN forwarding disabled. To also restrict clients on the VM’s VLAN, use the AdGuard access settings below.
Configure AdGuard Home
On the VM, run the first two commands. On your client, run the last with your username and VM address, then open http://127.0.0.1:3000.
- In the wizard, choose all container interfaces for the web UI on port 3000 and DNS on port 53. Compose port mappings restrict the host addresses.
- Create an admin account. In Settings → DNS settings, for example use https://dns.quad9.net/dns-query as upstream and 9.9.9.9 as bootstrap DNS, then test the upstream.
Terminalsudo docker compose config --quiet && sudo docker compose up -d sudo docker compose ps ssh -N -L 127.0.0.1:3000:127.0.0.1:3000 utilisateur@192.168.10.53Restrict resolver access
In Settings → DNS settings → Access settings, enter approved subnets under Allowed clients, for example 192.168.10.0/24. Match the list to the source addresses actually visible in the query log.
- Test a query from an approved client and from a network that should be blocked before changing DHCP. If Docker or a relay hides client addresses, enforce restrictions upstream where original source addresses are visible.
- Use an up-to-date Docker Engine, at least version 28. Earlier versions could allow peers on the same network segment to reach ports published to 127.0.0.1.
Create and test local names
Under Filters → DNS rewrites, add one name per service. Example mappings to adapt: pve.home.arpa → 192.168.10.10, nas.home.arpa → 192.168.10.20, and grafana.home.arpa → 192.168.10.30.
Terminalsudo apt install dnsutils dig @192.168.10.53 pve.home.arpa A +short dig @192.168.10.53 pve.home.arpa A +tcp +short dig @192.168.10.53 example.org A +shortThe first two queries should return the Proxmox IP and the last a public IP. To open Proxmox use https://pve.home.arpa:8006 with a certificate covering that name.
Advertise DNS to clients
Keep the router’s DHCP service. Set its IPv4 DNS option (option 6) to 192.168.10.53. Test on one client, then renew leases and check queries in the AdGuard Home log.
- On IPv6, check DNS advertised through router advertisements or DHCPv6 too. Another resolver or the browser’s secure DNS can bypass local names.
- For redundancy, advertise a second local resolver with the same records. If resolution fails during rollout, restore the previous DHCP DNS settings and renew the test client’s lease.
Back up and update
Schedule a short interruption, stop the container, and back up compose.yaml, .env, conf and work in a private location. Restart it after copying. Read the release notes before pulling a new image.
Terminalsudo docker compose pull adguard sudo docker compose up -d sudo docker compose ps