Posts: 72
cwilliams
Joined: 16 Aug 2013
#1
I don't know if some of you guys are aware of the benefits of running a huge hosts file.
If this post is not informative , remove it , I will understand.
Years ago I started using large hosts files to keep family from getting so many bugs and junk popups.
I'm the sys admin (non compensated) for my extended family so to speak .....
This is a text file located in / etc , it's just a text file.
For windows users it's in C:\windows\system32\drivers\ etc
What the file does is makes sure your machine will never connect to the ip addresses listed in the file.
The file I'm using is from
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.hosts-file.net/"
linktext was:"http://www.hosts-file.net/"
====================================
if it's ok to list.
The reason I got super excited about the file is on my present machine , I have a pretty extensive conky running.
My conky shows a total number of connections and names the first few by name.
I noticed at a Harley Davidson forum I was at that I had like 43 connections and I'm staring at 1 page.
This got me thinking , how fast would the same page be if I only had 4-8 connections at the time.
After using a large file from the above site , I had 12 or less going most of the time.
This was kinda cool , so I added some addresses just for kicks.
127.0.0.1
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.facebook.com"
linktext was:"http://www.facebook.com"
====================================
was my test address.
I added this to my wifes machine and when I heard the scream , I knew it worked , don't try this unless your wife has a sense of humor.
There are like 50,000 sites"you can't get to from here" with the large hosts file , and it's easy to edit , I use leafpad to comment the lines that are too restrictive for me , just a # at the beginning of the line does it.
Cruising the web is way faster for sure , and some nasty sites are fully blocked"from your machine" unless you choose to connect.
I use the first few lines of my antiX hosts file to make sure they are correct , then everything under #bad hosts begin here is used.
I rename my original hosts to bak.hosts and leave it in / etc just in case I need it later.
The new file must have the name"hosts" in order to work.
If you install this on a windows machine , turn off the DNS service or the connection will"stall" every once in a while.
Apparently windows doesn't speed read well.
My hosts file is now 12.9 MB , the standard first one you click on is about 11.1 MB and must be extracted to a folder before it is used.
Hey , I was bored and had itchy fingers.
Have fun
Colin
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
We have this as an advert block script
Posts: 1,028
SamK
Joined: 21 Aug 2011
#3
anticapitalista wrote:We have this as an advert block script
It gets lists to block from any of three sources. Set up is via
Control Center-->Network-->Adblock
Manual copying is not needed because it is menu driven. If wanted it can be reset to no blocking also via the menu.
Posts: 72
cwilliams
Joined: 16 Aug 2013
#4
Thanks guys , at least my way could help some windows users to some extent.
I was wondering what that button was for .........
I've been using antiX for years and never noticed the adblock thingy.
As usual , you have made some of the more arcane settings quite easy to manage.
Thanks again
Colin
Posts: 1,028
SamK
Joined: 21 Aug 2011
#5
cwilliams wrote:I've been using antiX for years and never noticed the adblock thingy.
It might be that your idea produces more extensive blocking than the one shipped in antiX. Perhaps it might be also be worth looking at something like this which can be installed as an addon to Iceweasel.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/gorhill/uBlock"
linktext was:"https://github.com/gorhill/uBlock"
====================================

It appears to be well respected.
Posts: 72
cwilliams
Joined: 16 Aug 2013
#6
Ok , so I used the antiX Advert Blocker , selected all 3 services , and came up with just under 1MB custom hosts file that it produced.
In my own style (If you didn't break it , you didn't learn anything) I took the custom files it produced and merged it into my custom hosts file.
My custom file is now 13.9 MB , it was about 12.9 MB before.
Bare in mind this has probably 300,000 sites listed and is very restrictive.
I had to comment out some of my favorite torrent sites , but it works really well.
I now have (as recommended)
Iceweasel 38.4.0
uBlock Origin 1.3.2
Disconnect 3.15.3.1
Toggle JavaScript 0.8
If you don't mind the hassle , the browser speed is quite fast and after watching the conky monitor , I have fewer meaningless connections per page , lots of white spaces , way less popups and ads.
I also did the recommended about:config items on this page.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://www.bestvpn.com/blog/8499/make-firefox-secure-using-aboutconfig/"
linktext was:"https://www.bestvpn.com/blog/8499/make- ... outconfig/"
====================================

Works just fine in Iceweasel.
Faster and more secure anyway.
Thanks for the tips.
Colin
Posts: 521
Shay
Joined: 20 Apr 2015
#7
I use uBlock origin.

Firefox and Iceweasle

Don't be surprised if it blocks

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sourceforge.net/projects/antix-linux/files/Final/MX-krete/"
linktext was:"http://sourceforge.net/projects/antix-l ... /MX-krete/"
====================================
Posts: 72
cwilliams
Joined: 16 Aug 2013
#8
Shay , you were correct.
I opened the link in a new tab and it got blocked , pretty neat.
I chose to disable strict blocking on the site permanently and all is good.
That worked pretty well.
I don't know if I like it better than adblock plus , but we'll give it a few weeks and see.
The sheer number of really good software is really mind boggling , I'm always impressed.
Thanks for your input.
Colin
Posts: 765
rust collector
Joined: 27 Dec 2011
#9
If you keep an eye on ram use, I think you might like ublock, if you compare to adblock
Posts: 69
Ninho
Joined: 28 Oct 2016
#10
Question: regarding the / etc/hosts in Linux, esp. antiX -
can we have several hosts per one single line just
like the host file in Windows (where one line can accept as many
as 9 hostnames, iirc, for one and the same IP) ? Does this trick
(useful for shortening hosts list somewhat) also work in Linux ?
Posts: 521
Shay
Joined: 20 Apr 2015
#11
uBlock Origin is a addon for Firefox now and I install it the first time I open Firefox.
Linux/Windows, it makes no difference
Most of the garbage comes from the ad servers, plus ad servers are what slows most sites down. Never mind the errors and stuff from the poorly written junk they have.
Posts: 69
Ninho
Joined: 28 Oct 2016
#12
Shay wrote:uBlock Origin is a addon for Firefox now and I install it the first time I open Firefox.
Interesting. Is it superior to Noscript, which is what I use here, in your opinion/experience ?
Posts: 521
Shay
Joined: 20 Apr 2015
#13
As I have never used Noscript, I am unable to compare them.

So checked and found this.
The NoScript Firefox extension provides extra protection for Firefox, Seamonkey and other mozilla-based browsers: this free, open source add-on allows JavaScript, Java, Flash and other plugins to be executed only by trusted web sites of your choice (e.g. your online bank).
While uBlock actually has a , I call it , list of Blacklisted urls to Block. And yes I have been known to add a few pesky ones to speed up a few sites.

So they are two different things in my book.
Posts: 69
Ninho
Joined: 28 Oct 2016
#14
Shay wrote:...While uBlock actually has a , I call it , list of Blacklisted urls to Block. And yes I have been known to add a few pesky ones to speed up a few sites.
So they are two different things in my book.
I see... thus, appears uBlock is more in the ad-blocker category, and hence is a (better) alternative to a plain"hosts" list, than a competitor for Noscript (the latter is excellent and imho"must have" FF extension, though it is not targetting adverts in particular).
Posts: 521
Shay
Joined: 20 Apr 2015
#15
Ninho wrote: I see... thus, appears uBlock is more in the ad-blocker category, and hence is a (better) alternative to a plain"hosts" list, than a competitor for Noscript (the latter is excellent and imho"must have" FF extension, though it is not targetting adverts in particular).
Thinking on that, I would say uBlock stops the add servers before Noscript has to go to work. Just a thought though.

I do have to use JavaScript about daily, so I can not really block it.