Block unwanted sites
If you are a System admin and wants to put some restrictions on websites within the organization, so that the other employees wouldn't be able to visits social networking sites, adult sites or other harmful sites, then you need to block those sites. There are many methods of restricting websites. You can use any particular softwares available to do the restriction task, you can also set your browser to block any sites. Alternatively you can also edit your Windows hosts file to restric websites. Here I will show you a very easy method i.e. how to edit your hosts file to block sites in Windows 7 . You don't have to use any applications, because the feature is available inside the Windows 7 itself. Lets see how to restrict sites.
Go to start->All Programs->Accessories->Right click on Notepad and Run it as Administrator. This step is very important because you cannot make any changes to the Windows file if you don't open it in Administrator mode. Windows just cannot allow other users to edit Windows own file and this good for security reasons.
You have your Notepad open now and its running in Administrator mode. Go to the File menu in Notepad and click Open.
When you click Open in the above step, a new Window will open, select the Local Disk C here, then select Windows.
Now select the System32 folder. Please see the image below.
After you click System32 folder in the above step, search for the derivers folder inside it and open it.
Now click on the folder etc to open it.
Inside the etc folder double click on the hosts file, it will open in Notepad. Please note that the type of file should be selected as All files otherwise you won't see any files inside the ets folder.
See the image below of the hosts file. If you want to block any sites you need to give the name of the website at the bottom of the file. In this example I tried to block the social networking website www.facebook.com. Add the localhost IP 127.0.0.1 then give space and the any website name you want to block. Try it. And when your done with the editing, save the file, try to open the blocked website by typing the URL on your web browser. You will be completely restricted to open that website.
That's it about how to block your website by hosts file in Windows 7.