The Host File of an operating system is like an address book used to associate host names with IP addresses, just like the Domain Name System (DNS). But unlike the DNS, the hosts file is under the direct control of the local computer’s administrator, and in most operating systems, the host file content is used preferentially over DNS. This allows the administrator to route traffic around the local network and block websites from being accessed or viewed. On standalones machine that aren’t part of a network, the host file can be efficiently used to block ads or adult websites across all applications – not only browsers.
There exist only one host file under Windows. To add new network routing rules or change existing ones you have to edit the host file and then save the changes. If you are testing a new network – say, you added a couple of new machines - and want to run some diagnostic, you will have to backup the contents of your current host file and replace it with new IP-address mappings. Once you are done, you have to copy the original host file back to where it belongs. You can avoid this by using a free utility called Host Profiles.
Host Profiles is a program that offers you the luxury of managing multiple host files and allows you to quickly switch between them. To add new host files, simply type a name which you can recognize later and click on the ‘Add’ button. Then enter the host-IP mappings. Click on ‘Apply and Flush DNS’ button to apply the new host file. The new host file become effective immediately without restarting the machine.
Be aware when you use Host Profiles for the first time, because it will not automatically backup your current host file. To do that you have to click on the ‘View Current Host’ tab, copy the contents, create a new host file – say, default – and paste the copied contents. Additional host files can be created as described in the previous paragraph.
It’s not only the network administrator that needs to manage multiple host files. The home user can take advantage of Host Profiles to maintain different block-list for different uses or users. You can use one block list for your office network and another when you are using your laptop at home. You can set a different block list when your kids are surfing the internet and switch to a more relaxed one for other family members or yourself.
Having said all that, Host Profiles is currently very unstable and buggy, at least on my machine, but seems to work despite the intermittent crashes.