In this tutorial we will look at how you can edit your hosts file in Windows 7. The process is pretty straight, and you can use this tutorial to do the same in Windows XP or Windows Vista.
Pretty well every platform will have a hosts file including Windows, Linux and Macs and it is an important file that can give you the ability to block certain sites from connecting with you, like advertising sites as well as blocking those addresses on all ports (IP Blocking tools) It can also be targeted by malware to stop you from accessing the internet, or act as a re-direct to dodgy sites, hence knowing how to edit it is useful. To edit the hosts file you will have to do it at an elevated level, so follow the steps below:
First, click Start>and type Notepad:
You will see Notepad appear in the list above. Right click on it and select Run as administrator:
A UAC window will pop up asking you Do you want to allow the following program to make changes to this computer? Click Yes, and Notepad will open up at the elevated level required. In Notepad do:File>Open. The Open navigation window will now open up, so navigate to the hosts file on the left by going Computer>Local Disk (C:)>Windows>System32>drivers>etc. Change the document type fromText Documents (*.txt) to All Files (*.*) Fig.2 which will then allow you to view the hosts file Fig.1
Note by default, the hosts file doesn’t have a program associated with it that will enable you to edit it which is why we are using Notepad. That said, Right click on the hosts file and select Open with. TheOpen with window will open. Locate Notepad and hit OK and the hosts file will open up in Notepad allowing you to edit it.
Once you have finished your edits go File>Save.
If you’d prefer to see a video version for this tutorial, I have made one for you below
That’s it, you’re done. I hope this has helped you out. Any questions, please ask below.