Hosts File Blocking

This cluster focuses on using the /etc/hosts file (or equivalent on Windows) to block advertisements, trackers, and unwanted websites, with discussions on its effectiveness, maintenance via lists like StevenBlack/hosts, and alternatives like AdBlock or uBlock.

πŸ“‰ Falling 0.3x Security
2,098
Comments
20
Years Active
5
Top Authors
#187
Topic ID

Activity Over Time

2007
1
2008
14
2009
29
2010
65
2011
98
2012
108
2013
108
2014
141
2015
203
2016
233
2017
155
2018
162
2019
177
2020
158
2021
105
2022
120
2023
95
2024
58
2025
64
2026
4

Keywords

APK DNS StevenBlack EasyList opendns.com Home.htm HTML DHCP OS AdBlock hosts h1 file block 127 host alias blocked dns reddit com

Sample Comments

mahmud β€’ May 1, 2010 β€’ View on HN

/etc/hosts is for your systems, use AdBlock for the junk ;-)

tehlike β€’ Dec 26, 2017 β€’ View on HN

The comment is gold: I'm confused, why not just use a HOSTS file to accomplish this?

mercurial β€’ May 8, 2015 β€’ View on HN

/etc/hosts is your friend.

Jaxan β€’ Sep 8, 2025 β€’ View on HN

Write your own hosts file and block all websites you don’t want to visit.

rbanffy β€’ Nov 21, 2018 β€’ View on HN

Looks like a good alternative to my ever growing /etc/hosts file that points every ad server I find objectionable to localhost.

charcircuit β€’ Jun 13, 2023 β€’ View on HN

The hosts file is not the right tool to do this.

steanne β€’ Jul 13, 2017 β€’ View on HN

okay, finally bit the bullet and blocked it in hosts file.

flenserboy β€’ Oct 2, 2022 β€’ View on HN

Anything we can toss into the HOSTS file to address this?

charcircuit β€’ Jul 27, 2025 β€’ View on HN

The hosts file doesn't let you properly block domains. It only lets you resolve them to something else. It's the wrong tool for the job.

rakoo β€’ Feb 10, 2021 β€’ View on HN

Wouldn't it be more practical as a ublock list ? It has auto-updating and is easier to set than editing /etc/hosts file