Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Wow, I didn't mean to start a flame war. Sorry, guys!
Thanks, Ruler2112 for your kind words, and to everyone else, yeah, there are certainly easier ways to block ads. I just found this hosts file and thought it was neat.
I might add in a little disclaimer that it's only for knowledge. I'm not recommending this tutorial, because there really are simpler ways of doing this, but there certainly isn't any harm in posting it here, or even following the steps.
Also, some people might find this comes in useful if they are using a very new, unstable browser that has no add-ons, etc.
EDIT: Just realized that the link to the hosts file has been modded out.
Anyway, thanks for reading, and I'm glad most of you seemed to enjoy it. I suppose it really is worthless now.
Since Adblock was mentioned I'll throw in that the Untangle Gateway has adblock now, so it can do ad blocking for your entire network while it's sitting at the gateway. Plus all the other nifty features of the UTM device..
I'm definitely one for knowing how to do something. many ways. This is yet another way to blacklist ip addresses from toturing you. Thanks for the post!
My understanding is having a huge hosts file slows down address lookups since every time you enter an address, your browser has to scan through 15,000 lines before realising www.google.com isn't a dodgy address. I may be wrong on this, but that is my understanding.
Not really... name lookups will have to do this anyhow for new domain names. For other, cacheable names, the browser will remember. For non cacheables (ads for instance) it will have to do the lookup every time, either in the hosts file or via DNS.
I just found this hosts file and thought it was neat.
And you're right, it is...
I, for one, am not a fan of loading layer upon layer of software on my network stack and/or browser. I really have no interest in privoxy, adblock and so on... they cause sluggishness, IMO.
This, simple, lightweight addition gives many of the benefits with little of the bloat.
I, for one, am not a fan of loading layer upon layer of software on my network stack and/or browser. I really have no interest in privoxy, adblock and so on... they cause sluggishness, IMO.
This, simple, lightweight addition gives many of the benefits with little of the bloat.
I'm betting a hosts file is a lot slower actually.
This, simple, lightweight addition gives many of the benefits with little of the bloat.
Since you say "gives many of the benefits" please explain how you would do this / block these using only your precious "simple, lightweight addition":
- incrementally update your blocklist,
- block ad-tracking cookies (for those using Firefox have a look at the www.ghostery.com plugin),
- block in-page ads residing in a path on the same server you visit,
- block ads from a hostname of which the domainname is the same as the server you visit,
- block ads presented through Javascript or Flash,
- block ads by host or path substring match,
- block only webbugs (you know, those tiny 1 pixel transparent images),
- set session-only cookies for a range of sites,
- selectively block popups, refresh-tags and redirects,
- keep images with specific sizes from displaying,
- block visiting domains based on content (like those parked sites).
Well, actually you don't need to try because you can't.
As such your "many of the benefits with little of the bloat" phrase can not based on reading (and actually understanding) what's been said in this thread already.
Also it turned out that the owner of the site where the hosts file resided is one of the Ubuntu people. That particular "hosts tutorial" got plastered over several web logs in the month it got posted here. Since this is not some radically new idea and the site owner does not make clear the content is not his but originates from mvps.org it must have been done purely for promotional purposes. He should have either linked to it or made clear it's not his work. File under plagiarism.
Last edited by unSpawn; 06-25-2009 at 05:37 AM.
Reason: more *is* more.
"I'm betting a hosts file is a lot slower actually."
I have and still use some pretty huge hosts files. There were some versions of OS's and some browsers that didn't work correctly but they are all now faster than a dns lookup is (assuming your hard drive isn't from 1990).
To reverse the issue, you can put a hosts file with only the few sites that you use. Don't use any dns ip. There are some ad's that are on an ip so they will show. Not sure you can fully block all ads ever.
using the hosts file this way is a very old trick. It still has it's uses but once it grows too large it can contribute some lag. And of course there are things it can't catch. But as a means of blocking specific IP's or host names it's fairly efficient, especcially for a short list.
I do have to chuckle at someone actually applying a licence of any kind to this as these lists have been around the net forever and are virtually all in the public domain. Trying to licence a particular list (which is undoubtedly a collation of other such lists strikes me as a bit over the top.
For many years I only could get a very slow dial up connection. It was usable on bulletin boards if you didn't mind paying long distance charges every night for a week to get a few floppies worth of data. When the internet took over I still had to use a text based browser. If you really want to speed up things you can try them. Once you get used to it, you wonder what the big deal is with other forms.
It may be that a person born into the web can't easily use a text based browser but at least try it.
I view the subject of ad's or unwanted content on a web page the same way I view OS/application security. I say my OS will be subject to an attack at some point no matter what I do. I can only limit my exposure. If you feel you have found some way to block content then there will be some new means to send junk to your browser. The worse offenders rely on new found holes in security. The really bad ones might get past any controls, because they know someone is trying to prevent them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.