Steven Black's hosts project merges reputable blocklists into deduplicated hosts files for malware, ads, and optional category extensions. It offers dozens of variants and tools to build or install them.
Overview
This project aggregates curated hosts data from multiple upstream sources into unified plain-text hosts files that map unwanted domain names to a blocking IP, commonly 0.0.0.0. The base merge removes duplicates and is updated on a schedule; many alternate recipes combine the unified list with optional extensions for categories such as fakenews, social media, gambling, and adult content.
Users can download prebuilt variants, generate customized files with Python, or run a container image that can replace the system hosts file on Linux when configured with extensions, whitelists, or blacklists. A command-line generator fetches fresh upstream data, supports backup before replace, compression options for Windows DNS client performance, and custom IP targets for blocked domains.
Because the hosts file is consulted before DNS on most operating systems, an updated list can stop requests to listed domains on the local machine. Documentation explains hosts file locations on macOS, Windows, and Linux, NixOS module integration, and how to contribute domains through upstream sources or local whitelist and myhosts overlays.
Key features
- Multi-source hosts list unification
- Optional porn, social, gambling extensions
- Docker image for automated updates
- Python generator with CLI flags
- Custom whitelist and blacklist overlays
- Compressed and minimized output formats
- Thirty-plus published file variants
- NixOS and package manager integrations
Use cases
- Network-wide ad and malware blocking
- Family or workplace content filtering
- Periodic hosts file updates via cron
- Custom domain blocklists on one PC
- NixOS-managed system hosts