A simple self-hosted DNS stack combining AdGuard Home with a private BIND 9 recursive resolver.
AdGuard handles filtering and client policies. BIND resolves domains directly through the DNS hierarchy, provides caching, and validates DNSSEC — without requiring a public recursive provider such as Google, Cloudflare or Quad9.
LAN / VLAN clients
|
| TCP + UDP 53
v
+----------------------+
| AdGuard Home |
| 172.30.0.4 |
| |
| filtering / policies |
+----------+-----------+
|
| private Docker network
v
+----------------------+
| BIND 9 |
| 172.30.0.3 |
| |
| recursion / cache |
| DNSSEC validation |
+----------+-----------+
|
v
Root -> TLD -> Authoritative DNS
BIND is never published on the Docker host. Only AdGuard can query it directly.
| Component | Role |
|---|---|
| AdGuard Home | Filtering, client policies, query logs, DNS frontend |
| BIND 9 | Recursive resolution, cache, DNSSEC validation |
| Docker network | Private communication between AdGuard and BIND |
- AdGuard Home DNS filtering
- Private BIND 9 recursive resolver
- DNSSEC validation enabled
- No public recursive DNS upstream required
- BIND isolated from the host network
- Restricted recursion/cache access
- Persistent AdGuard configuration
- Docker log rotation and resource limits
- BIND health check and startup ordering
- Validation, backup, update and migration scripts
- Optional
home.arpalocal DNS examples - GitHub Actions configuration validation
- Linux Distro
- Docker Compose v2
- A stable IP address
- TCP/UDP port
53available
Useful tools:
sudo apt update
sudo apt install -y ca-certificates curl dnsutilsAfter configuring a fixed IP address, the original v1 setup removed the DHCP client and rebooted:
sudo apt remove isc-dhcp-client -y
sudo rebootMake sure the server already has its intended static network configuration before running this step.
Check whether port 53 is already in use:
sudo ss -lntup | grep ':53'Clone the repository:
git clone https://github.com/1posix/adguard-bind9.git
cd adguard-bind9Create your local configuration:
cp .env.example .env
nano .envSet at least:
DNS_BIND_IP=192.168.1.10
WEB_BIND_IP=192.168.1.10Replace 192.168.1.10 with the IP address of your Debian host.
The internal Docker addresses are fixed by default:
BIND 172.30.0.3
AdGuard 172.30.0.4
If
172.30.0.0/24conflicts with an existing network, adapt the subnet and static addresses incompose.yamland the AdGuard ACL inconfig/bind9/named.conf.options.
Run the preflight checks:
./scripts/preflight.shStart the stack:
docker compose pull
docker compose up -d
docker compose psBIND should become healthy before AdGuard starts.
For a fresh installation, open:
http://SERVER_IP:3000/
Complete the setup wizard and create your administrator account.
Then open the normal interface:
http://SERVER_IP/
Go to Settings -> DNS settings and configure:
Upstream DNS servers:
172.30.0.3:53
Fallback DNS servers:
(empty)
Bootstrap DNS servers:
(empty)
The expected resolution path is:
Client -> AdGuard -> BIND -> Root/TLD/Authoritative DNS
Run the end-to-end test:
./scripts/test-dns.shIt verifies normal DNS resolution through AdGuard and performs a DNSSEC negative test with dnssec-failed.org.
A SERVFAIL response for that deliberately broken DNSSEC domain is expected.
Manual tests:
dig @192.168.1.10 example.org A
dig @192.168.1.10 dnssec-failed.org AReplace 192.168.1.10 with your DNS_BIND_IP.
Migrating from v1
Keep a backup of the old project before starting.
Stop the old stack:
cd /path/to/old/adguard-bind9
docker compose downFrom the v2 directory:
./scripts/migrate-v1.sh /path/to/old/adguard-bind9The migration helper keeps the existing AdGuard configuration and runtime data while replacing the old BIND configuration with the v2 resolver setup.
Then:
./scripts/preflight.sh
docker compose up -d
./scripts/test-dns.shKeep the old project until DNS resolution, filtering and the AdGuard interface have been verified.
Common operations
Status:
docker compose psLogs:
docker compose logs -f --tail=100 adguardhome
docker compose logs -f --tail=100 bind9Validate configuration:
./scripts/validate.shRestart:
docker compose restartStop / start:
docker compose down
docker compose up -dBackups and updates
Configuration backup:
./scripts/backup.sh configFull AdGuard backup:
./scripts/backup.sh fullBackups are stored in backups/.
Image versions are configured in .env, for example:
ADGUARD_IMAGE=adguard/adguardhome:v0.107.78
BIND_IMAGE=ubuntu/bind9:9.20-26.04_stableAfter changing an image version:
./scripts/update.sh
./scripts/test-dns.shPrefer deliberate version updates over unpinned latest images.
BIND can also provide optional local DNS using the RFC 8375 reserved domain home.arpa.
A complete generic example is available in:
examples/bind9/home.arpa/
├── db.home.arpa.example
├── db.192.168.1.example
└── named.conf.local.example
The example contains both:
- a forward zone: hostname → IP address
- a reverse zone: IP address → hostname
Generic records can be adapted to any home, lab or small-office network:
gateway.home.arpa
dns.home.arpa
server.home.arpa
nas.home.arpa
printer.home.arpa
client.home.arpa
For example:
server.home.arpa -> 192.168.1.10
192.168.1.10 -> server.home.arpa
Copy and adapt the example files to your own subnet, hostnames and addresses, then declare the zones in config/bind9/named.conf.local.
Validate the configuration before restarting BIND:
./scripts/validate.sh
docker compose restart bind9Private production zones should stay out of the public repository.
- BIND is not published directly on the Docker host.
- BIND recursion/cache access is restricted to AdGuard and localhost.
- Do not expose the AdGuard administration interface to the Internet.
- Only allow DNS access from trusted LAN/VLAN networks.
- Keep
.env, AdGuard runtime data, backups and private DNS zones out of Git. - Keep AdGuard Home and BIND updated after reviewing stable releases.
.
├── compose.yaml
├── .env.example
├── .gitignore
├── VERSION
├── CHANGELOG.md
├── config/bind9/ # BIND configuration
├── data/adguard/ # Persistent AdGuard data
├── examples/bind9/ # Optional local DNS examples
├── scripts/ # Validation / backup / update tools
└── .github/workflows/ # CI validation
- AdGuard Home
- AdGuard Home Docker documentation
- AdGuard Home releases
- BIND 9 documentation
- Canonical BIND 9 Docker image
- Docker Compose documentation
- RFC 8375 -
home.arpa
This repository is based on the original project:
Version 2 keeps the original goal — running AdGuard Home and BIND together — while redesigning the stack for stronger isolation, validation, DNSSEC and maintainability.