Hosts file is generally READ ONLY, in other words you cannot modify them in general. To edit a host file, you need to remove it from READ ONLY constraint and then move it anywhere else to edit it. It can be edited using NOTEPAD.
Windows 8 or 8.1Unfortunately Windows 8 makes it annoying to open apps as administrator — but it’s not too difficult. Just search for Notepad, then right-click on Notepad in the search results list, and choose to run it as administrator
Once you’ve done so, open up the following file using the File -> Open .
Then you can edit as normal.
Windows 7To access the hosts file in Windows 7 you can use the following command in the Run Line to open notepad and the file.
Once notepad is open, you can add any address at the end of the file as show in example below. Once you have done editing press Ctrl + S to save and then you can close the file.
If you are still unable to edit/save your hosts file then do the following NTFS permission settings.
Right Click on hosts file > Security > Users > Edit > Give full access > Apply > Ok