explaingit

stevenblack/hosts

📈 Trending30,373PythonAudience · generalComplexity · 2/5ActiveLicenseSetup · easy

TLDR

A hosts file aggregator that blocks ads, malware, and other unwanted domains system-wide across all apps and browsers without extensions.

Mindmap

mindmap
  root((repo))
    What it does
      Merges block lists
      Removes duplicates
      80000+ domains
    How it works
      Hosts file mapping
      Network-level blocking
      No extensions needed
    Use cases
      Shared computers
      Router filtering
      Device-wide blocking
    Customization
      31 optional variants
      Pick categories
      Combine as needed
    Tech stack
      Python scripts
      Ready-made files
      Download or build

Things people build with this

USE CASE 1

Block ads and malware across all apps on your computer without installing browser extensions.

USE CASE 2

Set up network-level filtering on a shared computer or router to protect multiple users.

USE CASE 3

Create a custom hosts file by combining optional category blocks like gambling, social media, or fake news.

Tech stack

Python

Getting it running

Difficulty · easy Time to first run · 5min

Requires root/admin privileges to modify system hosts file

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This project is a hosts file aggregator. A hosts file is a plain-text file on your computer that maps website names to IP addresses, your operating system checks it before reaching out to the internet. By pointing ad and malware domains to a dead-end address, a carefully crafted hosts file can block those sites system-wide, across every browser and app on your device, without any extension or software. The project pulls together several well-curated block lists from trusted sources, removes duplicates, and merges them into a single unified hosts file. It currently contains over 80,000 blocked domains covering adware and malware. Beyond the base list, it offers 31 optional variants you can pick based on what you want to block: you can add categories like gambling, pornography, fake news, or social media, in any combination. You would use this when you want a no-frills, network-level blocker that works without browser extensions, useful on shared computers, routers, or any device where you want broader coverage. The Python scripts in the repository handle the merging and deduplication, and updated files are provided directly for download if you just want the result without running any code.

Copy-paste prompts

Prompt 1
How do I download and install the stevenblack/hosts file on my Windows/Mac/Linux computer to block ads system-wide?
Prompt 2
Show me how to customize the stevenblack/hosts file to block gambling and social media in addition to ads and malware.
Prompt 3
Can I use the stevenblack/hosts file on my router to block unwanted domains for all devices on my network?
Prompt 4
How do I update the stevenblack/hosts file regularly to get the latest blocked domains?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.