How to edit Windows hosts file (C:\Windows\System32\Drivers\Etc\hosts)?

Windows users have a trouble saving plain TXT files without extensions on a Windows machine. For example, if you have to edit C:\Windows\System32\Drivers\Etc\hosts file and save as a plain text file, Windows will automatically add .txt file extension to the file and save it as hosts.txt. Also, Windows does not allow you to edit the file directly in the system folder such as the C:\Windows\System32\Drivers\Etc.

To get around this problem, you'll first have to change folder options of your Windows machine. To do this, please follow the instruction below.

1. Open Folder Options dialog window by clicking the Start button Windows Start Icon, clicking Control Panel, clicking Appearance and Personalization, and then clicking Folder Options.

Folder Options

2. As seen on the Folder Options window above, click View tab and uncheck Hide extensions for known file types, and then click Ok to save the change.

3. Save the hosts file as you normally would, and remove the extension if Windows added the .txt extension to the filename. To remove the extension, click on the filename with a left-mouse button and text box will appear as shown in the figure below.

Windows Hosts file

4. You'll have to drag-and-drop hosts file in the C:\Windows\System32\Drivers\Etc folder. The system may ask for Administrator's password if you do not have the administrative privileges.