# stevenblack/hosts

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/stevenblack-hosts).**

30,553 stars · 2,418 forks · Python · MIT

## Links

- GitHub: https://github.com/StevenBlack/hosts
- awesome-repositories: https://awesome-repositories.com/repository/stevenblack-hosts.md

## Topics

`ad-blocker` `anti-virus` `curated-sources` `gambling-filter` `hosts` `malware` `porn-filter` `pornblocker` `privacy` `protection` `python` `ransomware` `security` `social-media-filter` `trojans` `unified-hosts`

## Description

This project provides a system-wide content filtering utility that controls network traffic by redirecting domain resolution requests to local null addresses. By mapping unwanted hostnames to these addresses at the operating system level, it effectively blocks connections to advertising, tracking, and malicious domains across all applications on a machine.

The core of the system is a data-driven build pipeline that aggregates multiple curated source lists into a single, unified configuration file. This process is highly customizable, allowing users to employ declarative filtering logic through external blacklist and whitelist files to define exactly which domains are included or excluded. The build process is managed via a command-line interface, which supports various flags to control output formats, source selection, and custom domain mappings.

Beyond basic aggregation, the project supports diverse deployment scenarios, including containerized environments and integration with local network resolver services. It provides platform-specific utilities to ensure consistent application of these filtering rules, including mechanisms to manage local DNS client services for immediate configuration updates. The resulting output is designed to be environment-agnostic, maintaining compatibility across a wide range of operating systems and network services.

## Tags

### Security & Cryptography

- [Content Filtering](https://awesome-repositories.com/f/security-cryptography/content-filtering.md) — Restricts internet access by blocking connectivity to specific categories of websites across the entire machine.
- [DNS Filtering](https://awesome-repositories.com/f/security-cryptography/dns-filtering.md) — Restricts internet access by mapping unwanted domains to a null address at the local operating system level.
- [Network Traffic Filters](https://awesome-repositories.com/f/security-cryptography/network-traffic-filters.md) — Blocks malicious or advertising servers by redirecting domain lookups to a local null address.
- [Blocklist Aggregators](https://awesome-repositories.com/f/security-cryptography/blocklist-aggregators.md) — Aggregates multiple domain categories into a single deduplicated network filtering resource. ([source](https://github.com/StevenBlack/hosts/blob/master/readme.md))
- [Malware Protection](https://awesome-repositories.com/f/security-cryptography/malware-protection.md) — Blocks connections to known malicious websites and phishing domains at the system level to enhance network security.
- [Network Filtering Tools](https://awesome-repositories.com/f/security-cryptography/network-filtering-tools.md) — The project automates the application of blocklists to the local system hosts file to prevent connections to known malicious or advertising domains. ([source](https://github.com/StevenBlack/hosts/blob/master/updateHostsWindows.bat))
- [Domain Blacklists](https://awesome-repositories.com/f/security-cryptography/domain-blacklists.md) — Defines specific hostnames to be blocked during the automated build process.

### Development Tools & Productivity

- [Build Pipelines](https://awesome-repositories.com/f/development-tools-productivity/build-pipelines.md) — The project uses a data-driven build pipeline that processes raw text files through automated filtering and merging steps to produce a final network output.
- [Configuration Generators](https://awesome-repositories.com/f/development-tools-productivity/configuration-generators.md) — Merges multiple data sources and extensions into a single custom network file compatible with various computing environments. ([source](https://github.com/StevenBlack/hosts#readme))
- [CLI Configuration Tools](https://awesome-repositories.com/f/development-tools-productivity/cli-configuration-tools.md) — Supports command-line flags to customize output formats, file extensions, and source filtering rules for generated files. ([source](https://github.com/StevenBlack/hosts#readme))
- [Command Line Interfaces](https://awesome-repositories.com/f/development-tools-productivity/command-line-interfaces.md) — A build-time interface allows users to customize the generation process by passing flags that control output formats and source selection.
- [Domain Configuration Tools](https://awesome-repositories.com/f/development-tools-productivity/domain-configuration-tools.md) — Allows users to define and assign custom domain names to specific network addresses within configuration files. ([source](https://github.com/StevenBlack/hosts#readme))

### Networking & Communication

- [DNS Management Tools](https://awesome-repositories.com/f/networking-communication/dns-management-tools.md) — Provides capabilities for mapping hostnames to custom IP addresses to facilitate local domain resolution and internal network routing.

### System Administration & Monitoring

- [Ad Blockers](https://awesome-repositories.com/f/system-administration-monitoring/ad-blockers.md) — Intercepts and blocks advertisements and tracking scripts at the network level to protect privacy and reduce bandwidth usage.
- [DNS Management Tools](https://awesome-repositories.com/f/system-administration-monitoring/dns-management-tools.md) — Modifies local hostname resolution to block connections by mapping domains to a null address.
- [Network Resolver Configurations](https://awesome-repositories.com/f/system-administration-monitoring/network-resolver-configurations.md) — Provides ready-to-use configuration templates for integrating custom domain filtering rules into local network DNS resolvers. ([source](https://github.com/StevenBlack/hosts/blob/master/unbound.nix))

### Part of an Awesome List

- [Blocklists and Filters](https://awesome-repositories.com/f/awesome-lists/security/blocklists-and-filters.md) — Consolidated and deduplicated hosts files for security and privacy.
- [Identity and Privacy](https://awesome-repositories.com/f/awesome-lists/security/identity-and-privacy.md) — Tool for blocking undesirable websites via DNS blackholing.

### Software Engineering & Architecture

- [Filtering Engines](https://awesome-repositories.com/f/software-engineering-architecture/filtering-engines.md) — The system uses external blacklist and whitelist files to determine which entries are included or excluded during the consolidation process.

### DevOps & Infrastructure

- [Container Configuration Templates](https://awesome-repositories.com/f/devops-infrastructure/container-configuration-templates.md) — Provides standardized container configuration templates to ensure consistent and reproducible build environments. ([source](https://github.com/StevenBlack/hosts/blob/master/Dockerfile))
- [Configuration Management Tools](https://awesome-repositories.com/f/devops-infrastructure/configuration-management-tools.md) — Combines multiple source files into a unified configuration mapping hostnames to local loopback addresses.

### Data & Databases

- [Data Filtering Utilities](https://awesome-repositories.com/f/data-databases/data-filtering-utilities.md) — Provides a blacklist mechanism to automatically filter and remove unwanted domains during data consolidation processes. ([source](https://github.com/StevenBlack/hosts#readme))
