Skip to content

hosts

A combined blocklist of hosts-file entries that blocks ads, malware, and optional categories system-wide.

Stars
31.4k
Forks
2.4k
Licence
MIT
Language
Python
Last update
4 days ago
Type
Other

What it is

This project merges several existing hosts files from curated sources into one list with duplicates removed. A hosts file maps domain names to addresses, so listing ad and malware domains there makes your computer or network fail to reach them. You can also pick optional variants that add categories such as fake news, gambling, porn, or social media.

  • Download the unified hosts file and install it with a hosts-file manager
  • Choose a variant that adds porn, gambling, social, or fakenews blocking
  • Use the non-GitHub mirror if your hosts manager cannot fetch GitHub links

Great for

  • People who want to block ads and known malware domains across a whole device or home network
  • Users of hosts-file managers that can import a raw list
  • Parents or households who want an optional category filter such as porn or gambling
  • Anyone who prefers a simple text file over installing extra software

Not ideal for

  • Users who need fine-grained, per-site or per-user control, since a hosts file is all-or-nothing for each domain
  • Users who want blocking of ads inside a single browser, because a browser extension is simpler for that
  • People who need guaranteed filtering of encrypted or app-level traffic, since hosts files only match domain names
Step-by-step guide: how to use hostsInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    See the README

    Shallow clone the repository (README recommendation)

    git clone --depth 1 ...
  2. 2

    Run it

    • Choose a hosts file variant from the list in the README
    • Download its raw hosts file or use the non-GitHub mirror
    • Import or apply the file with your operating system or a hosts-file manager
    • Check that a blocked domain no longer loads
  3. 3

    Get the most out of it

    • Pick a variant that matches your needs, such as unified hosts plus porn or plus social
    • Use the non-GitHub mirror if your hosts manager cannot reach GitHub
    • Report content problems to the listed data source, as the README directs

Downloads

Strengths

  • Combines several curated sources into one list with duplicates removed
  • Offers many variants so you can choose which categories to block
  • Released under the MIT license and actively maintained, with a recent update noted in the README

Trade-offs

  • A hosts file only blocks by domain name, so it cannot filter every kind of content or traffic
  • The README notes that cloning the full repository is slow and recommends a shallow clone
  • Problems with specific entries must be reported to the original data source rather than this project

How it compares

ProjectStarsTypeLevelUpdatedBest for
hosts (this)31.4kOtherbeginner4 days agoPeople who want to block ads and known malware domains across a whole device or home network
web-check35.3kAppintermediate4 days agoDevelopers checking how a site is configured
whistle15.8kDev toolintermediate9 days agoFront-end developers who want to redirect or modify requests and responses without changing server code
Betterfox11kOtherbeginner2 months agoFirefox users who want privacy-focused defaults without installing extra software
macOS-Security-and-Privacy-Guide22.6kLearning resourceintermediate4 days agoMac owners who want a checklist of security and privacy settings to work through
RemoveWindowsAI13.6kDev toolbeginner7 days agoWindows 11 users who want Copilot and Recall removed

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.