Modifying your hosts file enables you to override the domain name system (DNS) for a domain on a specific machine. This is useful when you want to test a site on a new server without updating DNS records of the live domains


Modifying your hosts file causes your local machine to look directly at the IP address that you specify. 


Modifying the hosts file involves adding two entries to it in the format:


Hosts File (Windows)


If you are using Windows XP, Vista, 7, 8 or 10 you can modify the hosts file using Notepad.


Windows 10 and Windows 8


  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
  5. Make the necessary changes to the file.
  6. Select File > Save to save your changes.


Windows 7 and Windows Vista


  1. Select Start > All Programs > Accessories.
  2. Right-click Notepad and select Run as administrator. The Windows needs your permission UAC window appears. Click Continue to grant permission.
  3. Notepad opens. In Notepad, select File > Open. In the File name field, enter the following path: C:\Windows\System32\Drivers\etc\hosts
  4. Select Open.
  5. Make the necessary changes to the file.
  6. Select File > Save to save your changes.


Windows NT, Windows 2000, and Windows XP

  1. Select Start > All Programs > Accessories > Notepad.
  2. Select File > Open. In the File name field, enter C:\Windows\System32\Drivers\etc\hosts. Select Open.
  3. Make the necessary changes to the file.
  4. Select File > Save to save your changes.