Originally posted by ndmmxiaomayi:
HOSTS file for any operating systems. Note that the HOSTS
file only worked well in IE.
http://www.mvps.org/winhelp2002/hosts.htm
For Firefox, there's an addon known as Blocksite.
For those using Linux, the inbuilt firewall can be used to block
certain websites as well.
1. Start IPTables first. [b]sudo service iptables start or
su service iptables start or sudo su
service iptables start, depending on your Linux
distro.
2. Then add in the website you want to block:
iptables -A INPUT -s -i -d -p TCP -j DROP
If you don't know your network card interface, use the ifconfig
command for wired connections and iwconfig command for wireless. It
will list your interface. The one with the correct internal IP
address (not loopback IP address aka 127.0.0.1) will be your
network card interface. Usually is eth0 or eth1
If you use a third party firewall, some can be configured to block
websites. Check their manuals.[/b]
Oh. I thought a hosts file only exist in MS. Time to jump out of
the well.
But anyway, not just IE, any other browsers and applications that
require Internet connectivity goes through the hosts file as well.
Everytime a domain name require resolving (which basically means
translating "example.com" to "123.123.123.123", for example),
Windows reads the hosts file first before sending a request to a
DNS server to translate the domain name, results of which get
cached.