bindhosts icon

bindhosts

v2.1.5guide

Systemless hosts for APatch / KernelSU / Magisk

★1,438 stars
•Networking & Proxies•by bindhosts•WTFPL•Updated Aug 24, 2026
Roots:
✓ Magisk✓ KernelSU✕ APatch

Overview

Maintained by the bindhosts open-source team, Bindhosts is the modern successor to traditional hosts adblockers on rooted Android devices.

While legacy tools like AdAway required complex local web servers or full partition remounts, Bindhosts uses direct Linux kernel bind mounts (mount --bind). It compiles millions of verified ad, tracker, telemetry, and malware domains into a single unified /system/etc/hosts table that the Android Bionic libc DNS resolver uses natively across all applications.


Technical Architecture & How It Works

The Systemless Bind Mount

  1. Compilation Phase: Bindhosts fetches curated domain blocklists from high-reputation providers (StevenBlack, OISD, 1Hosts).
  2. Deduplication & Sanitization: The internal engine deduplicates entries, removes invalid syntax, merges user custom rules from custom.txt, and strips any domains specified in whitelist.txt.
  3. Loop Mount Staging: The compiled hosts file is written to /data/adb/bindhosts/hosts.
  4. Namespace Redirection: During the early boot phase (post-fs-data.sh and service.sh), Bindhosts executes:
    mount --bind /data/adb/bindhosts/hosts /system/etc/hosts
  5. Universal Enforcement: Because /system/etc/hosts is read by Android’s DNS resolver for every outbound network call, ads, trackers, and telemetry pings fail to resolve instantly with zero CPU latency.

Installation & Setup

  1. Open your root manager (Magisk, KernelSU, or APatch).
  2. Download and flash the latest bindhosts-vX.zip.
  3. Reboot your device.
  4. Open a terminal app (like Termux) and run the initialization command:
    su -c bindhosts -r
  5. Bindhosts will download the latest upstream lists, merge them, and apply the new hosts file immediately without requiring a reboot.

Configuration & Custom Rules

All configuration files reside in /data/adb/bindhosts/:

  • custom.txt: Add custom domains you want blocked:
    0.0.0.0 telemetry.example.com
    0.0.0.0 ads.targetapp.com
  • whitelist.txt: Add false-positive domains you want unblocked:
    s.youtube.com
    login.live.com
  • Updating via CLI:
    # Quick update
    su -c bindhosts -r
    
    # Check active hosts file size & count
    su -c bindhosts -s
    
    # Temporarily disable adblocking
    su -c bindhosts -d
    
    # Re-enable adblocking
    su -c bindhosts -e

Frequently Asked Questions

Does Bindhosts drain battery like VPN-based adblockers?

Zero battery drain. VPN adblockers (like AdGuard app or personal VPNs) run a local tun interface that inspects every network packet in userspace. Bindhosts operates at the OS kernel resolver level via /system/etc/hosts; blocked domains resolve instantly to 0.0.0.0 without any background packet parsing.

How do I whitelist a domain that broke an app?

Add the broken domain to /data/adb/bindhosts/whitelist.txt (one domain per line), then run su -c bindhosts -r in Termux to recompile the hosts file immediately.

Specifications

Prerequisites

  • Magisk, KernelSU, or APatch
  • Root access via shell or terminal

Known Conflicts

  • Legacy Systemless Hosts module (included inside Magisk settings)
  • Other hosts-replacing modules installed concurrently

Configuration Paths

/data/adb/bindhosts/custom.txt
/data/adb/bindhosts/whitelist.txt
/data/adb/bindhosts/sources.txt

Repository Details

Maintainerbindhosts
Repositorybindhosts
Latest Releasev2.1.5
Release DateAug 24, 2026
LicenseWTFPL
Open GitHub Repository →