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.
FAQ Category: Glossary