DEV Community

Cover image for One hosts file to block them all

One hosts file to block them all

Boris Schapira on September 13, 2018

As a field expert, people often ask me how to improve websites' performance. Sometimes, they also ask me how to improve the Web's performance on th...
Collapse
 
ahmedmusallam profile image
Ahmed Musallam

This is genius!! Makes me think of making a GUI for managing the hosts file. Or even multiple host files. Since the file format/structure is extremely simple, it would be extremely easy to parse! Slap a gui on it and you have the best add blocker there is!

This is definately going on my long list of things to build :) thanks for the inspiration!

Collapse
 
midblue profile image
Jasper Stephenson

What a great idea! Seems like it goes perfectly with the recent posts we've had about making desktop apps with vue through different tools!

Collapse
 
ahmedmusallam profile image
Ahmed Musallam

I love Vue, If I end up building this, it would definitely be in Vue :)

Collapse
 
phlash profile image
Phil Ashby

Nice job Boris :)

For those who run their own DNS server locally (come on I know this audience by now :)), I maintain a couple of scripts that pull Steven's excellent list and adjust for both IPv4 & IPv6 support plus local whitelisting, before dropping the result wherever your DNS server can load it. This will likely work just as well as a local /etc/hosts file if you don't run your own DNS...

github.com/phlash/sinkhole

I find this really helpful to reduce the pain of modern web browsing, detect infected devices on my network (friends mobiles typically!), and back up other tools like uBlock Origin.

Collapse
 
tux0r profile image
tux0r

Ha: my Windows can't resolve the IP address from that HostsMan website. Is it dead?

Collapse
 
borisschapira profile image
Boris Schapira

Can't access the website anymore, but it was up when I wrote the piece, a few days ago. I'll ping them on the birdsite. Thanks for the hint.

Collapse
 
borisschapira profile image
Boris Schapira

No answer from them, but I've found a portable version of hostsman and added the link to the post: portapps.github.io/app/hostsman-po...

Thread Thread
 
tux0r profile image
tux0r

Thank you. :)

Collapse
 
jabkarlsson profile image
αη∂єяѕ кαяℓѕѕση

I've been using this for ages> someonewhocares.org/hosts/

Collapse
 
susensio profile image
Susensio

pi.hole is also a pretty neat solution for blocking ads via DNS loopbacks

Collapse
 
midblue profile image
Jasper Stephenson

Hey, this is awesome! Is there a mac equivalent?