There might be various occasions on which you might want to edit your hosts file on windows system.
Anyway, to edit and safe hosts file on microsoft windows operating system without error, follow these steps.
1. Right click notepad.exe and select “open as administrator” (find notepad by going in start > all programs )
2. In notepad, click File > Open
3. Goto the hosts file directory on windows: (c:\windows\system32\drivers\etc )
4. Select “All files” from the options if “.txt.” is selected in notepad to show all files in that folder. Select hosts file.
5. Make changes to your hosts file now
Done. Your hosts file is now edited successfully and saved.