-
host file
so i just found out what a host file is/does and i was planning on using it to block certain websites. only one problem, when i went to C:\windows\system32\drivers\etc the file was empty. not really sure what to make of it, but what ever. i added all the default information that is in a host file and also a couple websites that i wanted to block but it doesn't seem to work. even after i saved the host file with the info i can still get into the sites that i blocked. any suggestions?
-
It's possible you have to reboot for the effects to show.
-
/etc/hosts on *nix
and C:\windows\system32\drivers\etc on windows (which seems one hell of a strange location, but never mind)
are not really meant to be used like this
They're designed to allow client machines to find IP addresses of local hostnames without the need to setup a full DNS server
Eg.
you could point my-server to 192.168.1.100
For a quick, dirty hack to re-route domain names, then fine
but it's not a website blocking solution
First up, if someone enters the IP address for a "blocked" site, it'll work
Plus, anyone with access to the machine and a vague idea of what to search for on google will be able to change the hosts file back
For blocking websites, it's better (safer, harder to circumvent, and less prone to problems) to use a proxy
For a proper web proxy, have a look at Squid
http://www.squid-cache.org/
-
It's not C:\windows\system32\drivers\etc, it's C:\windows\system32\drivers\etc\hosts. But okay.
They basically allow you to point a hostname to an IP. Say I'd want to point google.com to 127.0.0.1, I'd just add:
Code:
127.0.0.1 google.com
-
I can think of some fun ways to configure friends' computers using that. :O
But yeah. Not really best for blocking sites.