explaingit

stevenblack/hosts

Analysis updated 2026-06-20

30,310PythonAudience · generalComplexity · 1/5Setup · easy

TLDR

A unified hosts file that blocks over 80,000 ad and malware domains system-wide across every browser and app on your device, without needing any browser extensions.

Mindmap

mindmap
  root((hosts))
    What it does
      Blocks ads
      Blocks malware
      System wide
    Block categories
      Base 80k domains
      Gambling
      Social media
      Fake news
    Tech Stack
      Python scripts
      Plain text file
    Who its for
      Home users
      Router admins
      Shared computers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Block ads and malware on any computer system-wide without installing browser extensions or extra software.

USE CASE 2

Add optional block categories like gambling, social media, or fake news on top of the base list.

USE CASE 3

Apply network-level blocking on a router to protect every device connected to your home network.

USE CASE 4

Download the pre-built hosts file directly if you just want the result without running any scripts.

What is it built with?

Python

How does it compare?

stevenblack/hoststatsu-lab/stanford_alpacafujiwarachoki/moneyprinterv2
Stars30,31030,25330,387
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity1/55/53/5
Audiencegeneralresearcherpm founder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

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
I want to block ads on my Mac using the stevenblack/hosts file. Walk me through how to download it and apply it to my system.
Prompt 2
Using the stevenblack/hosts repo, show me how to generate a custom hosts file that combines the base list with the gambling and social media block lists.
Prompt 3
Help me set up a script that automatically updates my hosts file from stevenblack/hosts on a schedule so I always have the latest block list.

Frequently asked questions

What is hosts?

A unified hosts file that blocks over 80,000 ad and malware domains system-wide across every browser and app on your device, without needing any browser extensions.

What language is hosts written in?

Mainly Python. The stack also includes Python.

How hard is hosts to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is hosts for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub stevenblack on gitmyhub

Verify against the repo before relying on details.