Blocking websites without a filter

Place to talk about all that new hardware and decaying software you have.

Moderator: General Mods

Post Reply
neo_bahamut1985
-Burninated-
Posts: 871
Joined: Mon Sep 10, 2007 11:33 pm
Location: Unspecified

Blocking websites without a filter

Post by neo_bahamut1985 »

Okay, suppose I wanted to block specific websites and suppose I didn't want to use filtering software; my reason for not wanting to use filters is I think they cause more issues than they fix. The one I use now blocks websites that aren't even bad at least 95% of the time. Next I tried to add them to a block list in my D-link router. That didn't do anything, either. Then I stumbled upon this: http://www.sheeptech.com/block-websites ... -softwares which tells you how to edit the Hosts file in the Windows directory. This seems to be the least painful way of doing it, as there aren't that many sites to block. My questions are, however, one, is there a huge risk in doing this, and two, if it's perfectly safe, should I do it?
俺はテメエの倒す男だ! 宜しく! お前はもう死んでいる...
odditude
Official tech support dood
Posts: 2122
Joined: Wed Jan 25, 2006 7:57 am

Post by odditude »

having an oversized hosts file can increase DNS lookup times under windows NT - it's noticeable on a 1.6GHz atom n270 running XP SP3 (my cousin's netbook).

ymmv.
Why yes, my shift key *IS* broken.
MajereDB8
Rookie
Posts: 37
Joined: Sun Oct 09, 2005 12:32 am

Post by MajereDB8 »

Yes, that's a perfectly safe method of blocking websites. It just redirects any request to a particular domain name to your loopback adapter. The downside to that method is administrative overhead if you have a lot of computers or a lot of sites to block.

If you can get things to work on your router, that's probably the preferred method. It's easier to administer, and allows you to add DNS filtering to additional computers with minimal effort
neo_bahamut1985
-Burninated-
Posts: 871
Joined: Mon Sep 10, 2007 11:33 pm
Location: Unspecified

Post by neo_bahamut1985 »

Already got rid of that stupid filter and I'm using the other method and everything is up an running. Thanks!
俺はテメエの倒す男だ! 宜しく! お前はもう死んでいる...
byuu

Post by byuu »

odditude wrote:having an oversized hosts file can increase DNS lookup times under windows NT - it's noticeable on a 1.6GHz atom n270 running XP SP3 (my cousin's netbook).

ymmv.
Weird. Do they not use an O(log n) search algorithm for HOSTS or something?

The Atom is really peppy, too. It's on par with my Athlon 3500+.
Squall_Leonhart
Trooper
Posts: 369
Joined: Tue Jun 10, 2008 6:19 am
Location: Australia
Contact:

Post by Squall_Leonhart »

odditude wrote:having an oversized hosts file can increase DNS lookup times under windows NT - it's noticeable on a 1.6GHz atom n270 running XP SP3 (my cousin's netbook).

ymmv.
DNS Caching is useless anyway and leads to more problems then anything, which is why most people disable it.

host files above 300KB require you do so anyway.
[img]http://img.photobucket.com/albums/v253/squall_leonhart69r/Final_Fantasy_8/squall_sig1.gif[/img]
[url=http://vba-m.com/]VBA-M Forum[/url], [url=http://www.ngohq.com]NGOHQ[/url]
Francis64
Lurker
Posts: 160
Joined: Mon Jun 02, 2008 9:31 am
Location: UK

Post by Francis64 »

Yes this is a perfectly safe way to block websites on the PC.
(A large HOSTS file is known to slow down the system in Windows 2000/XP, but this is resolved when you disable the DNS Client service.)

I discovered this method a few weeks ago (on machines running Windows 2000 and 98) and it works great.
Almost no ads, and faster browsing.

There are places where you can download ready-to-use HOSTS files already that block most known sites containing ads, malware, tracking cookies etc.

http://www.mvps.org/winhelp2002/hosts.htm
http://everythingisnt.com/hosts.html
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

all in all, if you are using a hosts file, wouldn't it be better to block said sites at the router if possible?
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
Squall_Leonhart
Trooper
Posts: 369
Joined: Tue Jun 10, 2008 6:19 am
Location: Australia
Contact:

Post by Squall_Leonhart »

funkyass wrote:all in all, if you are using a hosts file, wouldn't it be better to block said sites at the router if possible?
No, routers rarely provide enough spaces to block these sites.
[img]http://img.photobucket.com/albums/v253/squall_leonhart69r/Final_Fantasy_8/squall_sig1.gif[/img]
[url=http://vba-m.com/]VBA-M Forum[/url], [url=http://www.ngohq.com]NGOHQ[/url]
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

lets look at the other side of the coin: what sites does he want to block?
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

byuu wrote:
odditude wrote:having an oversized hosts file can increase DNS lookup times under windows NT - it's noticeable on a 1.6GHz atom n270 running XP SP3 (my cousin's netbook).

ymmv.
Weird. Do they not use an O(log n) search algorithm for HOSTS or something?
In order to search it in log N time, they'd have to load up the HOSTS file, and then sort it in memory, or store it in a self sorting data structure.

If HOSTS was loaded up during boot up, this could be possible. Some web browsers (Konqueror) bypass whatever the OS does on the matter, and store their own DNS cache, which has quick access, and you need to shut down and restart the browser if you want it to relook at the HOSTS file.

It boils down to how often do you change it, would you want to require a reboot or a browser restart? Or do you want your browser/OS to constantly monitor for changes, and on each change made, reload the file?

Oh, and regarding blocking sites via it, it is possible to get Konqueror to completely ignore the hosts file, thus making such measures useless.

It seems that Konqueror unlike other browsers which ask the OS to do DNS lookup for it, Konqueror goes and talks to your DNS server directly, cutting your OS out. I'm just wondering if their is some "who is my closest DNS server" API I don't know about, or if it has the IP addresses to some DNS servers, and goes directly to them.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Post Reply