Android Ad Blocking Guide
🛡️ Block Ads System-Wide with Root Access
The complete guide to eliminating ads across your Android system using hosts-based solutions
NOTE
Not rooted? See the non-root alternatives guide for Private DNS, RethinkDNS, browser-based blocking, and patched-app options.
Table of Contents
- Why Root-Based Ad Blocking?
- Requirements
- Ad Blocking Methods Comparison
- Method 1: AdAway (Recommended)
- Method 2: Bindhosts (Advanced)
- Configuration & Optimization
- Troubleshooting
- Advanced Tips
- FAQ
Why Root-Based Ad Blocking?
Root access enables system-level ad blocking that surpasses traditional methods:
✅ Advantages of Root Ad Blocking
- System-wide protection - Blocks ads in all apps, browsers, and system components
- No battery drain - Unlike VPN-based blockers, hosts blocking adds no extra battery consumption
- No network overhead - Ads are blocked at the hosts file level before network requests
- Works offline - Continues working without internet connectivity
- Fewer ad requests - Pages and apps load without fetching ad content
🔄 How Root Ad Blocking Works
Root ad blocking operates by modifying the hosts file (/system/etc/hosts), which acts as a local DNS resolver. When an app tries to connect to an ad server:
- The system checks the hosts file first
- Ad domains are redirected to
0.0.0.0or127.0.0.1(localhost) - The connection fails instantly, blocking the ad
- Content loads without waiting for ad network requests
Honest limits: apps that use hardcoded DNS or DNS-over-HTTPS can bypass hosts blocking, and some first-party ads are served from the same domains as content. Pair hosts blocking with a DNS filter for those cases.
Requirements
📱 Device Requirements
- ✅ Rooted Android device (complete rooting guide)
- ✅ Magisk, KernelSU, or APatch installed (compare methods)
- ✅ Working root access (verify with a terminal:
su -c whoamishould printroot)
🔧 Supported Root Managers
| Root Manager | AdAway | Bindhosts | Notes |
|---|---|---|---|
| Magisk | ✅ Systemless | ✅ Magic mount (no WebUI) | Widest compatibility |
| KernelSU | ⚠️ Needs helper module | ✅ OverlayFS default, SuSFS modes | Use the systemless hosts module or AdAway Helper for AdAway |
| APatch | ⚠️ Needs helper module | ✅ hosts_file_redirect mode | Kernel redirect module available |
TIP
On KernelSU and APatch, AdAway needs the systemless hosts module or AdAway Helper to write the hosts file. Bindhosts works on all three managers without helpers.
⚠️ Important Notes
- Always know how to revert changes before proceeding
- Some banking and payment apps may require whitelisting
- OTA updates can reset direct system modifications; systemless methods survive them
Ad Blocking Methods Comparison
| Feature | AdAway | Bindhosts |
|---|---|---|
| Ease of Use | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| User Interface | Native Android app | Web UI + action button + terminal |
| Host Sources | Multiple built-in | Extensive collection |
| Customization | Good | Excellent |
| Root Hiding | Basic | Advanced (SuSFS, redirect modes) |
| Update Method | Built-in auto-updater | Self-updating |
| Best For | Most users | Power users, KernelSU/APatch |
Method 1: AdAway (Recommended)
AdAway is the most user-friendly root ad blocker for Android. It writes a merged hosts file systemlessly and also offers a local VPN mode for non-rooted devices. Also available in our ad blocker collection.
📥 Installation
- F-Droid (recommended): AdAway on F-Droid
- GitHub: AdAway releases
- Or install the APK directly with
adb install adaway.apk
⚙️ Initial Setup
- Launch AdAway and grant root permissions when prompted
- Choose blocking method:
- Root method (recommended on rooted devices): writes the hosts file systemlessly
- VPN method: local VPN that filters DNS requests, no root needed
- Configure hosts sources (see below)
- Apply changes - AdAway downloads and merges the lists
📋 Hosts Sources Setup
Navigate to Hosts Sources. AdAway ships with defaults (AdAway hosts, StevenBlack, Peter Lowe). Valid hosts-format sources you can add:
• AdAway default: https://adaway.org/hosts.txt
• StevenBlack Unified: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
• StevenBlack with social/fakenews/gambling/porn extensions:
https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
• Peter Lowe ad servers:
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
• AdGuard DNS filter (hosts format):
https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txtWARNING
Only use hosts-format sources. Adblock-syntax lists such as EasyList and EasyPrivacy are for browser blockers and do not work in AdAway.
🔧 Optimal Configuration
- Enable automatic updates in settings (daily or weekly)
- Configure the whitelist for apps that break when their domains are blocked
- Check the blocked domain count after applying to confirm lists loaded
Method 2: Bindhosts (Advanced)
Bindhosts provides systemless hosts blocking with auto-updating, AdAway coexistence, and multiple redirect methods for stronger root hiding. Find it in our ad blocking modules.
🎯 Why Choose Bindhosts?
- Fully systemless - no permanent system modifications
- Self-updating - maintains current hosts lists automatically
- Advanced root hiding - SuSFS bind mounts and in-kernel redirect methods
- Web UI management on KernelSU and APatch (Magisk uses the action button and terminal)
- AdAway coexistence - can run alongside AdAway
📥 Installation
- Download the module zip from GitHub releases
- Flash it in your root manager (Magisk, KernelSU, or APatch)
- Reboot, then open the module action button or Web UI
⚙️ Operating Modes
Bindhosts probes the best mode automatically. You can override it in the developer options:
| Mode | Method | Root Manager | Notes |
|---|---|---|---|
0 (default) | Magic mount / OverlayFS + path_umount | All | Automatic; AdAway compatible on Magisk and APatch |
1 | SuSFS assisted bind mount | KernelSU | Requires a SuSFS-patched kernel |
2 | Plain bind mount | All | Highest compatibility; leaks a mount if unassisted |
3 | hosts_file_redirect | APatch | In-kernel redirect; requires the KPM |
4 | ZN-hostsredirect | All with ZygiskNext | No mount; recommended by the author |
Higher SuSFS modes (overlay, bind + spoof, source mod) exist for KernelSU. See the official modes documentation for the full table.
🖥️ Web UI and Terminal
The Web UI (KernelSU and APatch) manages custom rules, sources, whitelists, and blacklists. From a root shell or Termux:
su
bindhosts # interactive menu
bindhosts --action # toggle apply/reset
bindhosts --force-update # update lists now
bindhosts --query doubleclick.net # check a domain
bindhosts --tcpdump # sniff active IPs (no DNS filter running)
bindhosts --custom-cron # set update hour
bindhosts --enable-cron # enable scheduled updates
bindhosts --force-reset # reset the hosts file📋 Custom Sources
Add hosts-format sources in the Web UI, or append them to the module's sources file, then run bindhosts --force-update.
Configuration & Optimization
🎛️ Whitelist Management
Apps that may need whitelisting when they break:
• Banking and payment apps (PayPal, Google Pay, Samsung Pay, regional banks)
• Social media (Facebook, Instagram) if feeds misbehave
• Google services (Gmail, Drive) if sync fails
• YouTube if in-app features breakAdAway custom rules: Your Lists → Allowed/Blocked Hosts. Bindhosts custom rules: add them in the Web UI.
📱 App-Specific Configuration
Chrome or WebView still showing ads on KernelSU: open KernelSU Manager → Superuser → Chrome (and Android System WebView) and disable Umount modules, so the browser sees the modified hosts file.
Troubleshooting
🔧 Common Issues & Solutions
Issue: Ads Still Appearing
- Confirm the blocker applied: check the blocked domain count in AdAway or run
bindhosts --query doubleclick.net - Reboot the device after applying
- Check the Chrome/WebView umount setting on KernelSU (see above)
- Hardcoded DNS apps: apps using DoH or fixed DNS servers bypass hosts blocking; use a DNS filter such as RethinkDNS for those
Issue: Apps Crashing or Not Working
- Whitelist the domains the app needs in AdAway or Bindhosts
- Remove conflicting sources that block content delivery networks
Issue: Banking Apps Fail
- Whitelist the bank's domains
- Configure root hiding (Zygisk denylist, Shamiko, ZygiskNext, or SuSFS)
- Some apps still refuse to run on rooted devices; this is not fixable by whitelisting
Issue: Slow Browsing
- Reduce sources: fewer, focused lists beat many large ones
- Remove duplicate sources that overlap heavily
🔍 Diagnostics
# Verify root works
su -c whoami
# View the effective hosts file
su -c head /system/etc/hosts
# Check whether a domain is blocked (bindhosts)
bindhosts --query doubleclick.netAdvanced Tips
🔐 Malware and Tracker Blocking
Hosts lists focus on ads. For malware and phishing, pair your blocker with a DNS filter (RethinkDNS, AdGuard DNS, or NextDNS), or use StevenBlack's alternate lists that bundle the social tracking extension.
🔄 Backup and Restore
- AdAway: use the built-in backup/export in settings
- Bindhosts: settings and sources live in the module folder under
/data/adb/modules/bindhosts/
🧩 Complementary Root Tools
- ForceDNS Cloudflare - forces all DNS traffic to Cloudflare via iptables
- AdGuard Home for Root - runs a full DNS filter on the device
FAQ
❓ Frequently Asked Questions
Q: Will ad blocking affect app functionality? A: Most apps work normally. Whitelist domains for apps that rely on blocked networks.
Q: Can I run AdAway and Bindhosts together? A: Bindhosts supports AdAway coexistence, but a single active hosts writer avoids conflicts. Do not run two hosts writers in competition.
Q: Do I need to update hosts files manually? A: AdAway has a built-in auto-updater, and Bindhosts self-updates on a schedule. Manual updates are a fallback.
Q: Will this work with a VPN? A: Yes. Hosts-based blocking operates below the VPN layer and works alongside VPN apps, unlike VPN-slot blockers.
Q: How much storage do hosts files use? A: Typically 1-3 MB depending on the sources. Very large lists can slow DNS lookups slightly.
Q: Does this work on mobile data? A: Yes, hosts blocking applies to Wi-Fi and mobile data alike.
Q: Will OTA updates remove ad blocking? A: Systemless methods (AdAway root mode, Bindhosts) survive OTA updates. Direct writes to /system do not.
Q: What about non-root ad blocking? A: See the non-root alternatives guide for Private DNS, RethinkDNS, browser extensions, and patched apps.
Related Guides
- 📖 Complete Android Rooting Guide - Start your rooting journey
- 🔧 Magisk Installation Guide - Popular systemless root
- ⚡ KernelSU Setup Guide - Kernel-based root with advanced hiding
- 🛠️ LSPosed Configuration - Advanced app modifications
- 🧹 Android Debloating Guide - Remove bloatware for better performance
- 🛡️ Privacy & Security Apps - Additional privacy tools
- 🔍 More Ad Blocking Solutions - Alternative blockers
Conclusion
Root-based ad blocking provides the most comprehensive way to eliminate advertisements across your Android system. AdAway suits most users with its simple interface and built-in updater, while Bindhosts suits power users who want SuSFS hiding, redirect methods, and KernelSU/APatch optimization.
Remember to:
- ✅ Keep your hosts sources updated
- ✅ Maintain a whitelist for essential apps
- ✅ Pair with a DNS filter for hardcoded-DNS apps
- ✅ Back up your configuration
📚 Part of the Awesome Android Root collection