Editing Windows Hosts File (Windows XP,Windows 7, Windows 8)
Windows hosts file is the file used by your Windows system to map host names to IP addresses. This is a plane text file and known as hosts file in all systems including MAC and Linux. If you need to edit your hosts file then you have come to the right place. But before proceeding to the editing part lets first know something about the windows hosts file.
Some Facts About Windows Hosts File
As I have already mentioned windows hosts file is the file used by your windows operating system to map host names to IP addresses. The entries in the host file looks as below:
# [Local Hosts]
The above example just contains some dummy data but the format is the same used everywhere. This host file is loaded into memory when you start your windows system. So whenever you look for any host or domain Windows checks this file first before it queries the DNS server. So for example you type localhost in your web browser the your system gets the mapped IP 127.0.0.1 from this host file and points to this IP.Note that this file does not have a file extension. Now lets see where to look for this file and how can you edit it under various Windows systems.
Editing Windows Hosts File
Lets first see how to edit host file under Windows XP system.
|Windows NT/2000/2003/XP Pro||%SystemRoot%\\system32\\drivers\\etc\\hosts|
|Windows XP Home||%SystemRoot%\\system32\\drivers\\etc\\hosts|
Where %SystemRoot% is the directory where Windows is installed. Generally it is c:\windows unless you installed in a different partition. %WinDir% is the directory where your Windows95/98/ME is installed, generally it is: c:\windows
Editing the Windows Hosts File
Its not difficult to edit the hosts file just open it in a text editor (Notepad) edit it and save it. Note that you must have admin access to edit this file.
Editing Hosts file Under Windows 7/Windows 8 system
It is bit tricky to edit hosts file under Windows 7/8. So lets see how do you edit it.
Step1: First of all navigate to the host file directory (%SystemRoot%\\system32\\drivers\\etc\\)
Step2: The files under this directory are hidden by default, so make sure that you disable hiding of files from the folder option menu. (Detail Process is Here: Show Hidden Files)
Step3: Go to run command and open Notepad as administrator (By right clicking and selecting Run as administrator)
Step4: Now as you can see the files under etc folder, you can also see the ‘hosts’ file, just right click on it and open with notepad and edit and save it.