By editing the Hosts file

Oct 3, 2007 10:42 GMT  ·  By

Windows Vista - just as its predecessor Windows operating systems - offers users the ability to easily control Internet browsing by managing the Hosts file, native to the platform. However, the main difference between Vista and older Windows titles is the introduction of the User Account Control, and the fact that all users run with standard privileges as opposite to administrative rights. This small detail subsequently impacts the ability to edit the Hosts file.

The fact of the matter is that there are two error messages generated in Windows Vista in certain scenarios that either deny access to the Hosts file, or refuse to apply any modifications made by the user. The first is "Access to C:WindowsSystem32driversetc hosts was denied" while the second will read "Cannot create the C:WindowsSystem32driversetchosts file. Make sure that the path and file name are correct."

What is interesting to note is that these error messages are generated even though the user logs into an administrative account and should have the necessary privileges to modify the Hosts file. Not the case with Windows Vista. As the Hosts file is often one of the areas of the Windows operating system hijacked by malicious code in order to control Internet browsing, Microsoft went an extra mile and set up some additional mitigations in place, restricting access.

Still, Vista users are by no means locked out of the Hosts file. But they will have to use an alternative way to open it. Either make your way to Notepad via Start, All Programs and Accessories, or simply enter Notepad in the search box under the Start menu. Right click the highlighted item and choose "Run as administrator" from the contextual menu.

Now, from Notepad go to File and Open in the menu, and navigate to "C:WindowsSystem32driversetc hosts." In the Open dialog box, choose the "All files" option in the drop down menu in the bottom right hand side corner and go ahead and open Hosts. Edit the changes you want and save. Windows Vista should no longer deliver any error messages.

You must understand that the Hosts file is essentially a local database of the operating system designed to map IP addresses to host names. Here is Microsoft's description of Hosts: "this is a sample HOSTS file used by Microsoft TCP/IP for Windows. This file contains the mappings of IP addresses to host names. Each entry should be kept on an individual line. The IP address should be placed in the first column followed by the corresponding host name. The IP address and the host name should be separated by at least one space."

As far as the ability to control Internet browsing in Windows Vista, you will be able to block access to certain websites. All you have to do is make proper use of the "loopback" entry: "127.0.0.1 localhost". Any web address that you want to block should be added as a line in the Hosts file under this form: "127.0.0.1 www.websiteToBlock.com".