How to modify your Windows host file?

Modifying your hosts file enables you to override the domain name system (DNS) for a domain on a specific machine. 


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

Modifying the hosts file involves adding two entries to it. Each entry contains the IP address to which you want the site to resolve and a version of the Internet address. For example, add the following two entries points, www.domain.com and domain.com to a windows host file.


64.49.219.194 www.domain.com
64.49.219.194 domain.com

After you add the domain information and save the file, your system begins to resolve to the IP address that you specified. 

Windows
If you are using a Microsoft operating system like Windows 10, Windows 8, Windows 7, and Windows Vista, you must run Microsoft Notepad as an administrator.
Windows 10 and Windows 8
•    Press the Windows key.
•    Type "Notepad" in the search field.
•    In the search results, right-click Notepad and select Run as administrator.
•    From Notepad, open the following file:
         c:\Windows\System32\Drivers\etc\hosts
•    Make the necessary changes to the file.
•    Select File > Save, to save your changes.

 

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

 

Date published: 03/06/2022