Windows 8, Windows 7 and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.
For Windows 8
1.Press the Windows key.
2.Type Notepad in the search field.
3.In the search right click Notepad and select Run as administrator.
4.In Notepad, open the following file:
c:\Windows\System32\Drivers\etc\hosts
5.Make the necessary changes to the hosts file.
6.Click File -> Save to save your changes.
For Windows 7 and Windows Vista
1.For Click Start -> All Programs -> Accessories.
2.Right click Notepad and select Run as administrator.
3.Click Continue on the "Windows needs your permission" UAC window.
4.When Notepad opens Click File -> Open.
5.In the filename field type:
C:\Windows\System32\Drivers\etc\hosts
6.Click Open.
7.Make the necessary changes to the hosts file.
8.Click File -> Save to save your changes.