Hosts file

The hosts file is a plain text file on your computer that is used by the operating system to map hostnames to IP addresses. The hosts file could be compared to a telephone directory; you look up a name in the directory and you find a number to call to contact that person.

When you type in a hostname in your Internet browser your system first checks its local hosts file to see if it has an IP address that corresponds to the hostname. If the entry exists you are redirected to that IP address otherwise your system checks elsewhere to try to resolve the hostname to an IP address.

So if you want to block an internet website, you could simply associate the sites hostname to a safe IP address in your hosts file. For example you could associate www.evil.com with the IP address 127.0.0.1 which is the local address of your computer.

This page shows content from our old website. It might move in the near future. To get the most up to date information, please use the navigation menu at the top.