All apps Β· 0 apps
adguardhome-unbound-redis
Docker app from pbear's Repository
Overview
Readme
View on GitHubπ AdGuard Home + Unbound + Redis
A Docker container combining AdGuard Home, Unbound (with DNS prefetching), and Redis as an in-memory caching layer β built for speed, privacy, and performance.
This image is multi-architecture and provides native support for both amd64 (PCs, Unraid servers) and arm64 (Raspberry Pi, Apple M-series, etc.) platforms.
π Why This Setup?
β Benefits of Unbound with Prefetching:
- Faster DNS Resolution: Frequently accessed DNS records are proactively resolved and cached.
- Lower Latency: Reduces delays caused by DNS lookups, especially useful for latency-sensitive applications.
- Better Network Performance: Prefetched responses are immediately available, reducing wait times.
π§ Benefits of Using Redis:
- In-Memory Speed: Redis caches DNS results in memory, offering near-instant retrieval.
- Improved Throughput: Offloads repetitive DNS requests from upstream servers.
- Reduced Load: Minimizes the number of external DNS queries.
- Reliable Caching: Maintains fast access even under heavy load.
π‘οΈ Security: Docker Hardened Image (DHI)
This image is built upon Docker Hardened Images (DHI), providing a higher level of security compared to standard base images:
- Minimal Surface Area: Only essential packages are included, significantly lowering the potential attack surface.
- Zero Known Vulnerabilities: Optimized to maintain a 0-CVE status for critical and high-priority vulnerabilities.
- Supply Chain Security: Digitally signed and verified base images with full SBOM (Software Bill of Materials) support.
- Immutable & Locked: The package manager and external repositories are locked after build to prevent unauthorized software installation at runtime.
β‘ Performance Tuning
This container is pre-optimized for high-throughput and low-latency DNS resolution:
- Unbound Slabs: Aligned to
4to match thenum-threadssetting, significantly reducing internal lock contention. - Redis RAM Optimization: Increased to
128MBwithlazy-freeingenabled, allowing non-blocking background deletions for smoother performance. - Unix Socket Communication: Communication between Unbound and Redis occurs via a Unix socket (
/tmp/redis.sock), bypassing the TCP network stack overhead.
[!TIP] Understanding Latency: Average response times around 30-40ms are normal for a recursive/forwarding setup. This average balances near-instant cache hits (<1ms) and the initial recursive lookups required to populate the cache [Inference].
π Quick Start (docker-compose)
Here is a sample docker-compose.yml to get you started.
version: "3.8"
services:
adguard-dns:
image: imthai/adguardhome-unbound-redis:latest
container_name: adguard-dns
# It's recommended to use a dedicated IP (macvlan/ipvlan)
# or, if in bridge mode, map the necessary ports:
ports:
- "53:53/tcp"
- "53:53/udp"
- "3000:3000/tcp" # AdGuard Web UI port
volumes:
# /config is the main volume for all config and data
- ./config:/config
restart: unless-stopped
βοΈ Configuration and Paths
π· Note for Unraid Users
This container is tailored to work well with Unraid:
- When adding the container, map the Container Path
/configto your desired Host Path inappdata, e.g.,/mnt/user/appdata/adguard-unbound-redis/. - It is highly recommended to assign a dedicated IP (e.g.,
br0.100) to the container, as port53is often occupied by Unraid/Docker.
π File Structure
All configuration is persisted in the volume you map to /config. After the first run, this folder will be populated with:
| Directory in your volume | Description |
|---|---|
./AdGuardHome/ |
AdGuardHome.yaml config and working data. |
./unbound/ |
Configuration files for Unbound. |
./redis/ |
Configuration file for Redis. |
./userfilters/ |
Place your custom filter files here. |
Default Settings:
- AdGuard Home Web UI:
http://<your-ip>:3000 - Default credentials:
admin/admin
π DNS Configuration
By default, Unbound is set to forward all DNS requests to public resolvers. Currently, Cloudflare DNS is used.
- You can modify this behavior in the
./unbound/forward-queries.conffile. - Other DNS providers are pre-defined and can be customized or added.
- To enable full recursive resolution (where Unbound queries root servers directly), simply delete the
forward-queries.conffile and restart.
π Custom User Filters
You can add your own filter blocklist files to the container by placing them in the /config/userfilters/ folder.
Important: To enable AdGuard Home to read your custom filter files, you must ensure that your configuration file (AdGuardHome.yaml) contains:
safe_fs_patterns:
- /config/userfilters/*
π Custom User Filters
You can now add your own filter blocklist files to the container by placing them in the /config/userfilters/ folder.
Important:
To enable AdGuard Home to read your custom filter files, you must ensure that your configuration file (AdGuardHome.yaml) contains:
safe_fs_patterns:
- /config/userfilters/*
You have two options:
Option 1: Manual update Edit
AdGuardHome.yamland add or update thesafe_fs_patternssection as shown above. Then restart the container.Option 2: Auto-generate fresh config Delete (or move) your existing
AdGuardHome.yamlconfig file and restart the container. The container will create a new config file with the correctsafe_fs_patternsentry by default. β οΈ Warning: This resets all your AdGuard Home settings!
Afterwards:
Add your local blocklist(s) in AdGuard Homeβs web UI (Filters β DNS blocklists) by specifying the file path, for example: /config/userfilters/myblocklist.txt.
π« Blocklists Enabled by Default
Enjoy faster, smarter, and more private DNS with this all-in-one Docker solution! π‘οΈβ‘
Install adguardhome-unbound-redis on Unraid in a few clicks.
Find adguardhome-unbound-redis in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Categories
Download Statistics
Total Downloads Over Time
Related apps
Explore more like this
Explore allDetails
imthai/adguardhome-unbound-redisRuntime arguments
- Web UI
http://[IP]:[PORT:3000]- Network
bridge- Shell
sh- Privileged
- false
Template configuration
- Target
- 3000
- Default
- 3000
- Value
- 3000
- Target
- /config
- Default
- /mnt/user/appdata/adguardhome-unbound-redis
- Value
- /mnt/user/appdata/adguardhome-unbound-redis
- Target
- 53
- Default
- 53
- Value
- 53