Live data from Hacker News

Using a Hosts File To Make The Internet Not Suck As Much

someonewhocares.org

51–60 of 104 posts

Re: Using a Hosts File To Make The Internet Not Suck As Much

#51

Be aware that this blocks Google Analytics and similar services. IMO it's a really bad idea to encourage users to block these services. For example, they are used by pretty much every software company to IMPROVE the product, and if they can't get data on what people use the most in their product, it may not get the attention it needs.

The reality is that so few people will actually install a hosts file like this, that it's not going to make an appreciable difference in any statistics.

Re: Using a Hosts File To Make The Internet Not Suck As Much

#52

Could someone post the same approach, but using bind (DNS), handling all those entries in one zone? Is it possible?

I run BIND at home for my network and take advantage of that to do the following: https://isc.sans.edu/diary/Easy+DNS+BIND+Sinkhole+Setup/7930

I also have a webserver that any black holed domain is sent to so that there is no waiting for a web request to time out. The first time I put it in place I didn't have the webserver so the performance when hitting one of these was horrible. I also use it for any ad server or analytic site I want to permanently block.

This way I don't have to distribute and update a hosts file to every machine in the house and I control where the offending sites redirect too.

Re: Using a Hosts File To Make The Internet Not Suck As Much

#53
post #36

I once had to troubleshoot why a Windows (XP I believe) computer was taking so long to browse the web. Turns out, it had a hosts file like this (generated from Spybot, IIRC). Cleaned out the hosts file, and it ran much faster. Just something to think about when using massive hosts files.

XP must not of being storing them in a decent data structure. Geez. I wonder if this is the case for windows 7?

Re: Using a Hosts File To Make The Internet Not Suck As Much

#54
There are frequent updates to this site, as new sites get added so often. In order to keep up with it, I wrote a lil script to download this and make it my host file, every so often (once a month in chron) saving the old one as a backup, of course. If I remember, I'll post it up on github this evening.

edit: I'll also add that this host file blocks adds on youtube, and pandora (and probably several others). I never wait for ads there anymore.

Re: Using a Hosts File To Make The Internet Not Suck As Much

#55

Or run your own caching recursive DNS server, and have it cache entries for as long as possible. Google DNS, Level 3 DNS can't shake a stick at my local cache, which is off course to be expected.

Care to link a tutorial on how to do this?

Depending on your OS, it is possible there is already something like this in place. IIRC, Ubuntu shipped with dnsmasq [1] at some point, thus maintaining a local DNS cache which in turn speeds up browsing. Otherwise, it's as easy as installing dnsmasq via your preferred package manager, and configuring dnsmasq.conf / resolv.conf

dnsmasq.conf needs to point to the DNS server you wish to use resolv.conf needs a line "nameserver 127.0.0.1" or whatever IP dnsmasq is listening on.

Make sure dnsmasq is started at boot, and that your resolv.conf isn't overwritten by your dhcp client, and you're good to go. Further configuration needs to done to make dnsmasq provide authoritative answers for other domains.

If you don't need caching, then use adsuck (linked it in my previous comment in this thread).

[1] http://www.thekelleys.org.uk/dnsmasq/doc.html

Re: Using a Hosts File To Make The Internet Not Suck As Much

#56
post #36

I once had to troubleshoot why a Windows (XP I believe) computer was taking so long to browse the web. Turns out, it had a hosts file like this (generated from Spybot, IIRC). Cleaned out the hosts file, and it ran much faster. Just something to think about when using massive hosts files.

XP must not of being storing them in a decent data structure. Geez. I wonder if this is the case for windows 7?

The more I think about it, the more I think it may have been Vista. Still doesn't bode well for Win7.

Re: Using a Hosts File To Make The Internet Not Suck As Much

#57
post #39

Wary of self-promotion here (sorry) but here's a gitHub repo that amalgamates and de-dupes recent hosts files from mvps.org, someonewhocares.org, and malwaredomainlist.com. https://github.com/StevenBlack/hosts

awesome, I haven't been using mvps.org or malwaredomainlist, I'll have to add those into mine. Thanks

Re: Using a Hosts File To Make The Internet Not Suck As Much

#58
post #51

Be aware that this blocks Google Analytics and similar services. IMO it's a really bad idea to encourage users to block these services. For example, they are used by pretty much every software company to IMPROVE the product, and if they can't get data on what people use the most in their product, it may not get the attention it needs.

The reality is that so few people will actually install a hosts file like this, that it's not going to make an appreciable difference in any statistics.

That is true, but it still conflicts with the purpose of this file, which is to "Make the internet suck less", while it instead, in the long term, may make the internet suck more. I don't see how blocking them makes it sucks less anyhow?

Re: Using a Hosts File To Make The Internet Not Suck As Much

#59
post #6
post #4

for domains you don't want to route try 192.0.2.x - that range is reserved for examples and won't end up with spurious requests to stuff you're running on localhost.

Will browsers immediately fail the connection, or will it try to make the connection and wait for a timeout? I generally use 0.42.42.42 because Class-A addresses can't start with 0, so they fail immediately.

IIRC, addresses 0/8 addresses are for multicast, so depending on your and your upstream's router configuration, that potentially sends those requests to a weird set of hosts on your class-A.
Post reply on HN