Live data from Hacker News

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

someonewhocares.org

61–70 of 104 posts

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

#61
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.

I would imagine it could put a significant dent in the already very small percentage of people using linux. Thus under representing it even further. Not that I'm too worried about it though.

edit: Looking through the current version of the host file, it appears google analytics and some other "non-nefarious" tracking sites are commented out.

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

#62
post #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…

Exactly this.

I have been creating master zones on my named.conf and pointing them to a blocked.txt file. My method is more cumbersome, the one you linked is very streamlined. Excellent, and thanks!

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

#63
post #2

In Australia the government went on this rampage of attempting to "protect" people through censorship. Perhaps a better solution would have simply been to ask Microsoft and Apple to distribute computers with a pre-loaded host file. Nice and easy to opt out, all while providing some decent protection from obvious silly sites.

Governments don't know enough about the internet to know what a hosts file is and I don't think we want them to.

Naw. /etc/hosts can be explained to a government.

But this kind of thing doesn't give your average government nearly enough power. So: not interested.

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

#64
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.

Yeah it was definitely Spybot. That was the first thing I thought of when I saw this. For the time, it was a good enough workaround in my experience. I don't really remember having network slowdown, but I may have been used to it since I think I was still on a blazing 56k modem at that point ;-)

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

#65
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.

Also did this. Once a domain is looked up and in the local DNS cache it's fine, but the initial DNS lookup can get stupidly slow, especially on older hardware.

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

#66
post #24
post #15

Think twice before using someone else's hosts file, unless you can actually review every entry. Not that I really think anything funny is happening here, but it is a huge security risk to use non-authoritative DNS like this by taking someone else on their word that their hosts file is legit.

If every entry routes to 127.0.0.1, what's the worst that could happen?

One can also null route them as well via 0.0.0.0. Hosts tend to die instantly that way versus timing out with 127.0.0.1

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

#67

I'd recommend Gas Mask for anyone editing their hosts file: (Plug for own site with similar stuff): http://pineapple.io/resources/gas-mask Gas mas direct link: https://code.google.com/p/gmask/

I tried Gas Mask a couple weeks ago, but it crashed every time I tried to edit the file list. I'm running Mountain Lion. At the time, I was busy on a project, so I didn't have any time to troubleshoot. I just gave up and uninstalled it.

It looks to be very useful so hopefully I can get it working sometime soon or at least be able to provide some crash feedback.

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

#68

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?

I personally run a local caching server on my home network. Rather than locally on my personal machine. That way I get the best of two worlds, when I move my laptop it will pick up new DNS fast and easy (especially if it is required for captive portals and the like) and at home I get fast speeds over the local network.

I run unbound, I don't have a tutorial or anything like that, mainly because I don't know what OS you are running or where you want to do this.

My personal unbound also connects to a locally hosted nsd, which is used to host the zone network.lan. On network.lan is where all of my hosts live, it is where I have entries for various of my internal servers, as well as all of my test sites.

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

#69
post #41

Dont know about the list linked directly, but I have used hostfiles to block plenty of sites. I avoid timeouts by running a small http service on localhost so that your browser can get a quick 404 response instead of a timeout..

I used to run a local server as well until I saw a recommendation to use 0.0.0.0. Requests now fail instantly and I don't have to run a local server just for blocked domains.

There is one thing I do miss: being able to log requests and seeing which domains were accessed the most.

Post reply on HN