To be able to edit the hosts file in windows follow these steps:
Recently ran into a situation where we needed to modify the hosts file in a windows machine. Our first option was to use notepad.exe as the text editor.
You can find the hosts files at: C:\Windows\System32\drivers\etc
When you open it and save the changes, you are prompted by the following:
Save As
C:\Windows\System32\drivers\etc\hosts.txt
You don't have permissions to save in this location.
Contact the administrator ot obtain permission.
Would you like to save in the Documents folder instead?