The “hosts” file is a plain text file in Windows named just that, hosts – without an extension. The file is located in “C:\Windows\system32\drivers\etc\
” folder. In all PCs, you will find a default hosts file or a text file called “lmhosts.sam”. This file with the extension “sam” is just a sample file and has no function other than to illustrate the format. While the Hosts file is often used users to block unwanted websites and adwares.
Hosts File Generator is a free portable utility that allows you to easily create, edit and backup Hosts file. This app helps users who are not familiar with editing hosts file a safe way to do so. The app can also come in handy if some malware tries to use the hosts file by altering it to direct well-known addresses to fake phishing site.
When you launch (requires administrator privileges) the app it will show three tabs in its user interface – Create Hosts File, Created Back-up and Advanced Settings. Before editing the file, first create a backup of the existing hosts file by clicking on “Created Back-up” button. Backup is saved at “C:\Hosts-Backup.”
If you don’t have a host file, or if you want to create a new hosts file click on the “Create Hosts File” button. Then you can add new entries to block by inputting their IPs or domains using the “Add new line” option provided. To delete an existing entry, select it and click on “Clear.”
When you have completed adding all entries, just click on the “Save” button to save changes.
The app also has an instant “Block Mode” option, which when clicked populates the hosts file with many popular websites and make them completely inaccessible by all applications on the computer.
The app works on Windows XP/Vista and 7, and requires .net framework 3.5.
Download: Hosts File Generator (155 KB) | Microsoft .NET Framework 3.5 SP 1
Update: Another nice tool to edit and manage Windows hosts file is Hosts Editor. It’s also a portable tool and is quit easy to use.
With it, you can easily enable or disable a particular mapping whenever you want. To do so, you just need to check/uncheck the checkbox corresponding to an IP address.
Download: Hosts Editor