Great for blocking or redirecting websites
Hosts File – Temporarily Map Domain Name to IP Address
When you type a website URL into your browser’s address bar, a request is sent to a type of Internet server known as a domain name server. This server takes the URL you type and then checks to see what specific IP addresses are listed for the actual servers that host the content you’re looking for.
The problem with this is that if there is something wrong with the nameserver, you will not be able to access the correct site. Even worse, if the nameserver has been hijacked, you may end up on a fake site! The good news is that you can manually specify the association between specific IP addresses and website addresses, simply by adding a local DNS lookup to your "hosts" file.
The hosts file is easy to understand. It is just a plain text file. This is actually why you should just edit the file with something like Notepad, which will not try to change the formatting or add any extra formatting to the file.