Singapore & Australia # 1 for Web Hosting & Domains
SG: +65 6914-7888   AU: 1300-863-436 Asset 1colo Help
Vodien Logo
  1. Home
  2. Knowledge Base
  3. Useful Tips
  4. How To Add and Edit Host File Entry for Windows PC

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. 
Tip: Type the name of the text editor in the Windows search box beside the Start button to find it right away.

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.  

Tip: If you can’t find it, display the hidden files and folders on your Windows PC.

Hosts File in Windows PC5. 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. 
Tip: Type the name of the text editor in the Windows search box beside the Start button to find it right away.

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.  

Tip: If you can’t find it, display the hidden files and folders on your Windows PC.

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. 

(Visited 75 times, 1 visits today)
Updated on January 31, 2023

Was this article helpful?

Related Articles