Dns resolver server and dns block
4.5K
High-performance DNS server with network-wide ad-blocking, written in Rust
Documentation • Quick Start • Configuration • Benchmarks • Roadmap
Full documentation is available at ferrous-networking.github.io/ferrous-dns.
The benchmark runs three scenarios against a 410,000-name working set, and all three are published — including the query log result, which is the one that still costs.
Resolving from cache, blocking off — at 847,711 queries/second (median of 3 runs, 8-core cpuset) ferrous-dns delivers throughput in the same tier as the resolvers written in C and C++, while running a full feature stack (DNS server, REST API, Web UI, SQLite query log, blocking engine) in a single process, which those resolvers do not have. Against the feature-comparable ad-blocking servers the gap is an order of magnitude: 9.9x Blocky, 7.2x AdGuard Home, 43x Pi-hole.
With a 1,000,000-rule blocklist enabled, throughput holds at 834,485 q/s — blocking costs 1.6%, and ferrous-dns runs 7.5x AdGuard Home (111,238) and 8.5x Blocky (97,947) on the identical rule set.
Turning the query log on is what costs. Throughput falls to 262,298 q/s, 69% below blocking alone, and the log is not lossless: this run dropped 144,447 entries. The producer uses a non-blocking send on a bounded channel and discards rows when that channel is full, so the number above is the cost of logging what fit, not of logging everything.
Read the median, not a single run: run-to-run variance on this host is ~10–15%. Numbers come from a
RUSTFLAGS="-C target-cpu=native"build; the published Docker image is generic and will measure lower on the same hardware.
docker run -d \
--name ferrous-dns \
--restart always \
--network host \
--user 1000:1000 \
-e FERROUS_CONFIG=/data/config/ferrous-dns.toml \
-e FERROUS_DATABASE=/data/db/ferrous.db \
-e FERROUS_DNS_PORT=53 \
-e FERROUS_WEB_PORT=8080 \
-e FERROUS_BIND_ADDRESS=0.0.0.0 \
-e FERROUS_LOG_LEVEL=info \
-e TZ=America/Sao_Paulo \
--dns 10.0.0.1 \
--cap-add NET_BIND_SERVICE \
ferrousnetworking/ferrous-dns:latest
Access the dashboard at http://localhost:8080
See full installation guide for Docker Compose, build from source, and Raspberry Pi setup.
services:
ferrous-dns:
image: ferrousnetworking/ferrous-dns:latest
container_name: ferrous-dns
restart: always
network_mode: host
user: "1000:1000"
environment:
- FERROUS_CONFIG=/data/config/ferrous-dns.toml
- FERROUS_DATABASE=/data/db/ferrous.db
- FERROUS_DNS_PORT=53
- FERROUS_WEB_PORT=8080
- FERROUS_BIND_ADDRESS=0.0.0.0
- FERROUS_LOG_LEVEL=info
- TZ=America/Sao_Paulo
dns:
- 10.0.0.1
cap_add:
- NET_BIND_SERVICE
volumes:
- ferrous-data:/data/
volumes:
ferrous-data:
docker compose up -d
git clone https://github.com/ferrous-networking/ferrous-dns.git
cd ferrous-dns
cargo build --release
./target/release/ferrous-dns --config ferrous-dns.toml
See the full configuration reference for all options.
| Variable | Default | Description |
|---|---|---|
FERROUS_CONFIG | — | Path to TOML config file (optional) |
FERROUS_DNS_PORT | 53 | DNS server port |
FERROUS_WEB_PORT | 8080 | Web dashboard port |
FERROUS_BIND_ADDRESS | 0.0.0.0 | Bind address |
FERROUS_DATABASE | /data/db/ferrous.db | SQLite database path (in the Docker image) |
FERROUS_LOG_LEVEL | info | Log level: debug, info, warn, error |
mDNS device discovery (
mdns_enabled, off by default) listens on UDP 5353 for multicast announcements. It requires host networking (network_mode: host) — multicast does not traverse Docker bridge port mapping.
Performance — Cache docs
Dashboard — Dashboard docs
Encrypted DNS — Encrypted DNS docs
dns.google.com resolved at startup)Upstream Management — Upstream docs
Blocking & Filtering — Blocking docs
*.ads.com)Client Management — Client docs
Security — Security docs
X-Api-Key header)Malware Detection — Malware Detection docs
.invalid domains (RFC 6761) and converting hijacked responses back to proper NXDOMAINCompatibility & Deployment

Bug reports, feature requests, and pull requests are welcome.
Dual-licensed under MIT and Apache 2.0.
Content type
Image
Digest
sha256:d3a6cce0e…
Size
30.3 MB
Last updated
5 days ago
docker pull ferrousnetworking/ferrous-dns