How to Edit Host File in Windows 10

When working with Kamatera servers or setting up applications locally, you may need to modify your local hosts file to map domain names to specific IP addresses.

The hosts file is a local plain text file that maps hostnames (such as domain names) to IP addresses. It serves as the first step in the domain name resolution process before the system queries external DNS servers.

Editing the hosts file in Windows 10 allows you to override DNS settings and manually control how your system resolves specific domain names. This is especially useful for testing websites, previewing server migrations, or troubleshooting network connectivity.

Step-by-step guide

  1. Click on the Start menu, and type Notepad.

2. Right-click Notepad and select Run as administrator.

Note: Administrative privileges are required to edit system files.

3. A pop-up window titled “User Account Control”, appears with the message “Do you want to allow this app to make changes to your device?” Click Yes.

4. In Notepad, click File-> Open.

5. Navigate to the following path: C:\Windows\System32\drivers\etc. In the bottom-right corner of the dialog box, click on the drop-down menu and change the file type from Text Documents (*.txt) to All Files.

6. Select the file named hosts and click Open.

7. At the end of the file, add the appropriate IP and hostname at the end of your hosts file in the following format: 

Example: 192.168.1.10 testserver.local

Note: You can add multiple entries, one per line.

8. After editing, click File-> Save. Close Notepad.

9. Open the Command Prompt as Administrator.

10. Run the following command:

Command:

 ipconfig /flushdns

This clears cached DNS entries, ensuring your changes take effect immediately.

 

Editing the hosts file in Windows 10 is a simple yet powerful way to control how your system resolves domain names. Whether you’re testing a new Kamatera server, verifying website migration, or troubleshooting network issues, modifying this file allows you to redirect domains locally without affecting live DNS records.  

Note: Always remember to back up the original hosts file before making changes to ensure easy restoration if needed.

 

 

Have additional questions? Search below: