One of the functions of the Hosts file is to block or allow Internet pages as you need.
The hosts file from Windows XP to Windows 7 is on this path:
C: > Windows > System32 > drivers > etc
To modify this file in previous versions of Windows 7 is only access to this location, open the file, modify and save changes.
But this does not work in Windows 7, trying to save the changes makes the system to display a window where it says you can not save in that directory which suggests to keep a copy in My Documents. To change this follow the steps:
1) You must enable show all hidden files and folders.
2) Open the “Notepad” and do not open with double click! Right click and click Run as administrator:
The system may prompt you to allow execution; you should click yes.
3) Once open Notepad go to File -> Open:
You may access the hosts file along your path: C: > WINDOWS > system32 > drivers > etc
Upon reaching the etc. folder; you will not able to see the hosts file. To get the access it must selected to show all files from the drop down menu as shown in the image:Advertisement
4) Open the hosts file. Once you opened it, you can edit the hosts file according to our needs. The picture shows an example of how to block a page. Write 127.0.0.1 ; domain name of the page with www and another same line the without www.
5) Save the changes and close Notepad.
1. Always use both with www. extension and non www. version of the website which you want to block.
2. It is very useful for parents, system administrators to disallow certain website(s) to be accessed from that particular computer.