StevenBlack hosts: the size arithmetic that decides which variant you install
🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
At a glance
- What is it?
- The StevenBlack hosts repository is an aggregator that merges several curated blocklists into one file, with duplicates removed, and then offers 31 variants of the result. Choosing between them is mostly a question of file size, because the base file already carries 77,758 entries and the porn variant roughly doubles that (154,222), and each update means rewriting a file inside a system directory.
- Who is it for?
- The StevenBlack hosts file fits an individual machine or a small network where DNS resolution happens on the box and you want a maintained merge of several blocklists rather than an ad blocker extension, and it fits a DNS server operator who can point a resolver at the file.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- StevenBlack/hosts31,468 ★ · +427
| Repository | 2026-09-11 | 2026-11-15 |
|---|---|---|
| StevenBlack/hosts | 31k | 31.5k |
427 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
An aggregator, and the four upstreams it merges are named in package.json
The project describes itself in one emphatic line: therefore this repository is a hosts file aggregator. What that means is that the file at the root of the repository is generated output, not hand-maintained content. Several reputable hosts files are consolidated and merged with duplicates removed, and the useful detail about where they come from is not in the README but in the npm manifest, whose description names adaway.org, mvps.org, malwaredomainlist.com and someonewhocares.org, with the qualifier and potentially others. The same manifest lists ransomware and trojans among its keywords, which is the clearest statement of intent in the repository. The consequence of the aggregator model shows up in how you report a problem. Only issues and pull requests about changes to the one data file under the project's own directory belong in this repository. Everything else about the content of the produced file should go to the data source that contributed it, and the contact details for all of them are kept in the data directory.
requirements.txt is two lines, and one of them is a linter
The whole pipeline is smaller than the output it produces. The requirements file asks for two packages: an HTTP client for fetching the upstream lists, and a linter. There is no database, no framework and no scheduler. The scripts at the root do the work, with one that builds the merged file, one that refreshes it from the data directory, one that regenerates the README, and one that tests the result. The container build installs exactly those two requirements and nothing more.
RUN pip install --no-cache-dir --upgrade -r /hosts/requirements.txtThe npm manifest is worth understanding because it looks like a JavaScript package and is not one. The main field is empty, the package is marked private, the only development dependency is the release tool, and of the three scripts, two are Python invocations (test and start) while release runs release-it. So package.json exists to drive releases and to give the repository a version, and its version field is where the release number comes from.
Adding porn more than doubles the file and adding fakenews adds about 2,600 lines
The variants are presented in a table with a unique domain count for each, and those numbers make the decision for you. The base file, which merges the adware and malware sources, has 77,758 entries. Add fakenews and it becomes 80,327, an increase of roughly 2,600. Add social and it is 81,916. Add gambling and it is 84,851. Add porn and it is 154,222, which is about double the base. The standalone extensions show the same asymmetry from the other direction. The fakenews-only file has 2,187 entries, social-only has 3,808 and gambling-only has 6,723, while porn-only has 76,801, about the same size as the entire base file. So the porn extension is roughly thirty five times the size of the fakenews one. Multiply the extensions and you pass 150,000 lines, and the repository tracks its own growth in a file named for hosts file size history.
A shallow clone is the documented default, because the history goes back to 2018
The first thing in the README is a warning rather than a greeting, and it is about git rather than about blocking. Cloning this repository can take a long time, and the reason given is that you probably just want to start with the latest version rather than its whole history since 2018. The suggested remedy is a shallow clone, written in the README in the abbreviated form git clone with the depth flag set to 1. The advice is sound because of the release cadence, not just the age. Releases arrived as 3.16.126 on 2026-10-28, 3.16.127 on 2026-10-29 and 3.16.128 on 2026-11-01, so this is a project that ships every few days. Downloading a shallow copy and replacing it wholesale is therefore the sane pattern, and a history you are never going to read is pure cost. There is also a mirror on a domain other than GitHub, offered for hosts file managers such as Hostsman for Windows that will not accept GitHub download links.
disable-dnscache-service-win.bat exists because Windows will not see the change otherwise
The Windows path is different from the Unix one and the repository says so with filenames rather than prose. There are two update scripts for Windows, one a batch file and one a PowerShell script, and a third batch file whose name is the whole point: it disables the DNS cache service. That file is the answer to the most common failure mode of this kind of setup, where someone replaces the hosts file, reloads nothing, and concludes the blocklist is broken. The operating system's resolver is not guaranteed to consult the file on every lookup once a name has been cached, so a first run on Windows is a two step operation and the repository ships the second step as a script. Three example files at the root handle the personal additions case, with a file for your own entries, a blacklist and a whitelist, which decide what survives the merge and what you add afterwards.
unbound.nix puts the file on a DNS server instead of inside the operating system
Two of the files at the root change the shape of the deployment. There is a flake definition, and beside it a module for Unbound, which is a recursive DNS resolver. That pair means the file can be consumed by a resolver you control rather than written into an operating system's resolver configuration, which is a different integration model with a different update story, since the resolver reads the file instead of the system stack picking it up. The container route is the third shape. Its base is a Python Alpine image, it sets a flag marking that it is running inside a container, installs git and sudo, copies the repository into place, and adds that directory to the executable path so the scripts are callable by name. The repository also contains notebooks and shell scripts for source statistics.
3.16.118 shipped on 2026-09-27, and the README is itself a build artefact
Maintenance is not the question here. The repository is not archived, the last push landed on 2026-11-01, and the releases follow it within seconds, with 3.16.128 as the current version and the same date shown as the last updated line in the README. The licence is MIT. The more interesting structural point is that the documentation you are reading is generated. The README is produced from a template file using a data file, by one of the scripts at the root, and the table of unique domain counts and the list of variants are part of that output. That is why the table's counts and the entry count in the introduction match.
Editorial conclusion
The StevenBlack hosts file fits an individual machine or a small network where DNS resolution happens on the box and you want a maintained merge of several blocklists rather than an ad blocker extension, and it fits a DNS server operator who can point a resolver at the file. It does not fit an organisation that needs to control the blocklist itself, because the content belongs to the upstream sources and complaints have to go to them, and it does not fit anyone unwilling to run the update scripts, because new releases arrive every few days. Verify three things before installing: which variant's line count you can live with, since the base and the porn-only file are both around 77,000 lines while the combined variants pass 150,000, whether your platform has a way to flush or disable the DNS cache so the new file takes effect, and whether the four upstream sources the description names are the ones you actually want blocking your traffic.
Frequently asked questions
How do I use a hosts file to block websites?
Point the operating system at a hosts file whose entries map the domains you want blocked to a dead address, which is what this repository produces. The file at the root of the repository is the merge of several curated sources with duplicates removed, and it had 77,758 entries as of November 1 2026. The repository offers 31 further variants in its alternates directory, each with and without the unified file included.
How do I add a hosts file in Windows 11?
The repository ships a batch file and a PowerShell script that update the Windows hosts file, plus a separate batch file that disables the DNS cache service, which is needed so the operating system actually picks up the change. It also publishes a mirror on a domain other than GitHub for hosts file managers such as Hostsman for Windows that will not accept GitHub download links.
Which StevenBlack hosts variant should I install?
Start from the counts in the variant table. The base file has 77,758 entries, adding fakenews gives 80,327 and adding social gives 81,916, while adding porn gives 154,222, about double. On their own, the fakenews-only file has 2,187 entries and the porn-only file has 76,801, so the porn extension is roughly thirty five times the size of the fakenews one.
How do I build the StevenBlack hosts file myself?
Clone the repository, preferably shallow, and install its two Python requirements, an HTTP client and a linter. The build is driven by makeHosts.py, which the npm start script invokes, and the test suite is testUpdateHostsFile.py, which the test script invokes. A Dockerfile is included that installs the same two requirements and puts the repository directory on the executable path.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/stevenblack-hosts)Star history chart for your README
[](https://hysenlabs.com/projects/stevenblack-hosts)Was this useful?