How to Add IP Address to the Hosts File in Windows System

Step 1: Find the hosts file from the following location: C:\windows\system32\drivers\etc, as shown in the figure below:

Step 2: Add records according to the format of "ip domain name", and the IP and domain name need to be separated by spaces, as shown below:

Note: You can open the hosts file as .txt file and modify it.