Loading...

Knowledge Base

How To Add and Edit Host File Entry for Windows PC

A host file entry consists of a domain name and an IP address of the hosting server. When you access the domain name, your browser will redirect you to that hosting server which could be different from the actual live website. This is necessary if you test a staging site, given that it is hosted on a different server. Add and edit a host file entry using the guides below. 

Add a Host File Entry

Add a host file entry if there is none for your domain name or website. Follow the steps below to add the entry.  

  1. Right-click on your preferred text editor (ex. Notepad or Notepad++) from the Windows Start button. 

2. Select Run as administrator. Then, Yes to apply the changes.

Run Notepad++ as Administrator

3. Open your computer’s File Explorer and click your Local Disk (C:) .  

4. Open the hosts file by following this file path Windows\System32\drivers\etc\hosts. Open the file using the same text editor that you ran as an administrator in Step 2.  

Hosts File in Windows PC

5. Add the host entry at the bottom with the following format:  

IP[space]domain name[space]domain with www

Following the format above, the host entry should look like this:

123.45.67.890 yourdomain.com www.yourdomain.com

6. Save the changes to the text editor.  

Edit a Host File Entry 

Edit a host file entry if you want to change the IP address for the same domain name or website. You need to do the same thing to disable it so that you can access the actual live website.  

  1. Right-click on your preferred text editor (ex. Notepad or Notepad++) from the Windows Start button. 

2. Select Run as administrator. Then, Yes to apply the changes.

Run Notepad++ as Administrator

3. Open your computer’s File Explorer and click your Local Disk (C:) .  

4. Open the hosts file by following this file path Windows\System32\drivers\etc\hosts. Open the file using the same text editor that you ran as an administrator in Step 2.  

Hosts File in Windows PC

5. Look for your domain name or website name and replace the IP address to change it. If you need to disable the host entry, remove it from the list.  

6. Save the changes to the text editor. 

 

Did you find this article helpful?

 
* Your feedback is too short

Loading...