How often should this script be run to update the hosts (weekly, monthly) or is it a one time deal?
Theres some conflicting posts in this thread about changing the host address to 0.0.0.0 instead of leaving them as 127.0.0.1 (or what ever standard is), some clairification on this? Safe to do? Evolution and other mail programs still work?
Any other reccomended hosts lists to add?
Thank you for your help and the info.
OK, glad you got it working.
It is the same list as is used for AdblockPlus.
Update, up to you. I think the list itself is updated either daily or almost daily. I personally update it (when I use a hosts file) every few months, sooner if I start seeing ads.
On a desktop you could use either 0.0.0.0 or 127.0.0.1 , on a server (which I would not advise) you should probably use 127.0.0.1.
You can use either, easy enough to switch if you have a problem.
Alternates to a host file would include a proxy (privoxy) or using adblock extensions with your browser.
Each has advantages and disadvantages.
The disadvantage of a hosts file is that you need to manually keep the list up to date and you would have to keep it up to date on each desktop.
The disadvantage of browser extensions is that they apply to a single browser for a single user. The advantage is that these lists are typically more up to date and easier to customize per user.
For multiple users on a lan a proxy makes more sense, but it takes a bit more knowledge to set up and not all users may need the same content filtering.
You will have to decide for yourself what makes the most sense.
I had to log in just to thank you for this. I work in IT and never even knew about this.(never got deep into the internet\web part of IT)....What's got me so happy is I often work off of a broadband card when I'm out and about. I hate the freezing,especially any video(youtube,etc.) but just accepted it....until today. It's like i just went from a modem 54k to a DSL connection. THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!
Lastly, it takes VASTLY more time to explain than the two or three keystrokes take to do ... so it' 'seems' confusing ... but it's really simple.
First off, once in vi, you MUST clearly get yourself in the command mode by using the ESCAPE key religiously! (Hit it once, hit it twice, and, for good effect, if you're uncertain, hit it thrice!). You only need to hit it once, but, I need to underscore the point that you must be in the right mode.
Also, you must be using a vi editor. There are lots of them. Vi, vim, Gvim, etc. (all will have 'vi' in the name somewhere). Or, just open up a terminal window and type:
Once you have an empty file "foo" open, import the hosts file:Code:vi /tmp/foo
The ":r" means to "read in" the file which follows "/etc/hosts".Code:ESCAPE:r/etc/hosts
Now, with your "j" key, move down (use the "k" key to move up).
At some point, hit "mx" (that will mark that spot as an "x"). Then use your "j" and "k" key again to go to a different spot and then hit "my". Now you've marked a spot as a 'y').
At this point, do whatever you want between those two spots, e.g., to sort:
Which, interpreted, is:
: = command
'x = from x
'y = to y
!sort = run the sort command
If things don't seem to work, hit the escape key a few times (and stay away from the 'i' key while doing commands.
Hope this helps.
Last edited by rocksockdoc; April 25th, 2011 at 01:45 AM.
Firstly Thank you for the help, slowly but surely I'm learning
I got it to work but a few more details I'd like. What is vi I guess I mean in contrast to an editor like gedit?
When I do a "mx" should a physical mark be made on the document (e.g. an x) something to note you did it?
Are there any other navigation keys other than j and k, as that could take a very long time to get to the bottlom of a large hosts file?
Save and exit, how do I do it?
I think thats it for now, again thank you for the help.