Hosts file updating

This morning, I found a list of domains that the nice people at FProt posted which are likely to be bringing bad things, and their names have to do with swine flu.  So I set out to add them to my hosts file, to avoid any problems from them.

Darned if my hosts file wasn’t completely empty — just the stuff that Windows brought with it. 

So I looked around and found a few more robust hosts files, downloaded them, sorted them, and then merged them, culling out the duplicates.  I did all this quickly and easily with some standard command line applications under Cygwin (sort, comm, and grep — my first time with grep — and a perl one-liner I snagged from someplace). 

Now, there are places where you can get updated hosts files with frequent updates, and I won’t be updating this file all that soon, but, in case somebody wants to try it out, you can check it out here.  Copy and paste that onto the end of your hosts file, and you’ll be a lot less vulnerable to ad servers and nasty things on different websites. 

For some guidance about how to do this under Vista, this article is quite useful — especially the comment half-way down about setting up a short-cut to allow you to do it quite easily.  And, for those who don’t know what I’ve been talking about all this time, a hosts file is a list of domain names and ip addresses.  When you try to access a domain name, your system will look to see if that domain name is on that list, and, if it is, will use the ip address listed for it in the place of that domain name.  The hosts file I’m talking about here lists domain names of domains that serve up ads, malware, and bad things, and gives 127.0.0.1 as the ip address for all of them.  127.0.0.1 is the address for the local system (aka “localhost”), and, by pointing all those domain names at it, none of the files on those nasty domains will be loaded on your computer, because it will look for them on itself, and they aren’t there — all requests will time-out instead. 

If you find that something you want to do is blocked by this, just edit the file and remove the name of the domain you want to reach.  Not complicated.

2 thoughts on “Hosts file updating

  1. Why don’t you just use opendns as your dns server instead. Much more robust at blocking sites, which can be done by category, and actually serves up a bage stating why it’s been blocked. I’ve used it now for almost two years and have yet to have any inappropriate site not blocked.

  2. I do use opendns as well. And the Web of Trust extension in Firefox. I use a variety of protective layers, including a very skeptical mind when it comes to accepting what a website claims to be, and, to date, have never had a piece of malware run on any computer I’ve owned.

Leave a Reply

Your email address will not be published. Required fields are marked *