βββ βββ ββββββ βββ ββββββββββββββ βββββββ βββββββ βββββββββββββββ
βββ ββββββββββββββ ββββββββββββββ βββββββββββββββββββββββββββββββββ
βββ ββββββββββββββ βββββββββ βββ βββ βββββββββββββββββ ββββββββ
ββββ βββββββββββββββ βββββββββ βββ βββ βββββββββββββββββ ββββββββ
βββββββ βββ βββββββββββββββ ββββββββββββββββββββ ββββββββββββββ βββ
βββββ βββ βββ βββββββ βββ ββββββββ βββββββ βββ ββββββββββββββ βββ
DNS β High-performance, privacy-focused ad & tracker blocker
A high-performance, privacy-focused custom Rust DNS filtering engine and caching resolver that blocks ads and trackers system-wide β runs directly on your Android phone via Termux, no root required.
Repository β’ Documentation β’ Report Bug β’ Request Feature
- About the Project
- Key Features
- Architecture
- Tech Stack
- Getting Started
- Configuration
- Usage
- Blocklist Sources
- Project Structure
- Features & Roadmap
- Testing
- Deployment
- Contributing
- Security
- License
- Acknowledgments
VantaDNS is a custom-built DNS filtering engine engineered in Rust to provide comprehensive, system-wide protection against advertisements, trackers, telemetry, and malicious domains. Unlike traditional cloud-based DNS services, VantaDNS is designed to run locally on your Android device using Termux. This ensures that your DNS queries never leave your device until they are securely forwarded to trusted upstream resolvers like Cloudflare, Google, or Quad9.
Achieving system-wide ad blocking on Android typically necessitates device rooting, paid VPN subscriptions, or reliance on third-party DNS providers that may log your browsing history. VantaDNS eliminates these requirements by operating on localhost, intercepting DNS traffic through a local UDP forwarder, and returning NXDOMAIN for over 800,000 known ad and tracker domains.
- π Extreme Performance: Built with async Rust (Tokio), providing sub-millisecond response times through a high-speed radix trie matching engine.
- π‘οΈ Massive Rule Coverage: Supports over 800,000 blocking rules from premium sources including OISD, Hagezi Pro++, StevenBlack, and 1Hosts Lite.
- π¦ Versatile Parsing: Native support for AdGuard (
||domain^), Adblock Plus, wildcard (*.domain), and standard hosts file formats. - π DNS-over-TLS (DoT): Optional RFC 7858 compliant TLS listener for secure, encrypted DNS resolution.
- π§ Intelligent Caching: Configurable LRU (Least Recently Used) cache with smart TTL clamping to minimize upstream latency.
- π± Zero Root Required: Utilizes a specialized UDP forwarder to operate within Termux's unprivileged environment.
- π Reboot Resilient: Integrated with
Termux:Bootfor automatic background startup after device reboots. - π― One-Tap Control: Home-screen widget support via
Termux:Widgetfor instant toggling of ad-blocking services.
graph TD
A[Android Apps] -->|DNS Query| B[Android System DNS]
B -->|127.0.0.1:5353| C[UDP Forwarder Script]
C -->|Local Forward| D[VantaDNS Core :8533]
D -->|Check Cache| E{Cache Hit?}
E -- Yes --> F[Return Cached Result]
E -- No --> G{Filter Engine}
G -- Blocked --> H[Return NXDOMAIN]
G -- Allowed --> I[Upstream Forwarder]
I -->|TCP/UDP| J[Cloudflare/Google/Quad9]
J -->|Response| K[Update Cache & Return]
- Language: Rust 2021 Edition
- Runtime: Tokio 1.38 (Full async stack)
- Networking:
tokio-rustls 0.26,rustls-pemfile 2.0 - Data Handling:
serde 1.0,toml 0.8,ahash 0.8 - CLI & Logging:
clap 4.5,tracing 0.1
- Forwarder: Python 3 (Async UDP listener)
- Management: Bash (Automation and installation scripts)
- Platform: Termux (Android Linux environment)
| Component | Requirement | Note |
|---|---|---|
| Termux | Latest Version | Use F-Droid or GitHub builds; Play Store version is obsolete. |
| Termux:Boot | Latest Version | Required for autostart functionality. |
| Termux:Widget | Optional | Recommended for home-screen control. |
| Android OS | 7.0 or higher | Compatible with ARM64 devices. |
| Storage | ~100 MB | For binary, blocklists, and cache storage. |
To install VantaDNS on your phone, execute the following commands in Termux:
# 1. Update system and install dependencies
pkg update -y && pkg install -y git python bind-tools unzip
# 2. Clone the VantaDNS repository
git clone https://github.com/vincenzo-afk/VantaDNS.git
# 3. Execute the automated installer
bash ~/VantaDNS/phone/install.sh
# 4. Start the VantaDNS service
bash ~/VantaDNS/phone/vanta-vpn.sh startFor developers wishing to build from source:
# Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Clone and build
git clone https://github.com/vincenzo-afk/VantaDNS.git
cd VantaDNS/dns-core
cargo build --releaseVantaDNS is configured via a vanta-dns.toml file. The phone-specific configuration is located at phone/phone-vanta-dns.toml.
[server]
bind_addr = "127.0.0.1:8533"
upstreams = [
"tcp:1.1.1.1:53",
"tcp:8.8.8.8:53",
"udp:9.9.9.9:53"
]
block_mode = "nxdomain"
[cache]
capacity = 50000
min_ttl_secs = 60
max_ttl_secs = 86400
[filter]
blocklist_paths = [
"$HOME/VantaDNS/config/blocklists/oisd-big.txt",
"$HOME/VantaDNS/config/blocklists/hagezi-pro-plus.txt"
]# Start all VantaDNS components
bash ~/VantaDNS/phone/vanta-vpn.sh start
# Stop all VantaDNS components
bash ~/VantaDNS/phone/vanta-vpn.sh stop
# Check the current status
bash ~/VantaDNS/phone/vanta-vpn.sh status# Test blocking (should return NXDOMAIN)
dig @127.0.0.1 -p 8533 doubleclick.net
# Test resolution (should return an IP address)
dig @127.0.0.1 -p 8533 google.comVantaDNS aggregates several high-authority blocklists to ensure maximum coverage:
| Source | Approx. Rules | Focus |
|---|---|---|
| OISD Big | 269,000+ | High-quality, zero false-positive ad blocking. |
| Hagezi Pro++ | 240,000+ | Aggressive blocking including phishing and scams. |
| 1Hosts Lite | 60,000+ | Optimized list for trackers and telemetry. |
| StevenBlack | 99,000+ | Unified hosts for ads and malware. |
| KADhosts | 62,000+ | Fraud and malware prevention. |
| Hagezi TIF | 50,000+ | Threat Intelligence Feed for active security. |
VantaDNS/
βββ dns-core/ # Rust-based DNS filtering engine
β βββ src/ # Core logic (Trie, Cache, Resolver)
β βββ tests/ # Unit and integration tests
βββ phone/ # Android/Termux deployment scripts
β βββ install.sh # Automated phone installer
β βββ vanta-vpn.sh # Service management script
βββ config/ # Configuration templates and blocklists
βββ docs/ # Detailed documentation and guides
βββ guides/ # User-facing master guides
βββ releases/ # Pre-compiled binaries for ARM64
- High-performance Rust filtering engine
- Sub-millisecond Radix Trie matching
- DNS-over-TLS (DoT) support
- Multi-format blocklist parsing
- Automated Termux deployment
- One-tap home screen toggle
- Web-based dashboard for statistics
- DNS-over-HTTPS (DoH) support
- Dynamic per-client filtering rules
VantaDNS includes a comprehensive test suite covering unit logic and integration scenarios.
cd dns-core
# Run all unit tests
cargo test --test unit_tests
# Run integration tests (requires local environment)
cargo test --test dot_integrationWhile optimized for Android, VantaDNS can be deployed in various environments:
- Local Linux/macOS: Run the
dns-corebinary directly. - Docker: A
Dockerfileis provided for containerized deployment. - Cloud: Compatible with Fly.io and Render (see
docs/cloud-deployment.md).
Contributions are welcome! Please read our CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
If you discover a security vulnerability, please refer to our SECURITY.md for instructions on how to report it.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 vincenzo-afk
- Special thanks to the maintainers of the blocklists: OISD, Hagezi, StevenBlack, PolishFiltersTeam, and 1Hosts.
- Gratitude to the Termux community for providing a powerful Linux environment on Android.