How to edit the hosts file in Windows 10

If ever it is required to edit the hosts file in Windows, here are the steps you need to follow.

The process of modifying hosts file in Windows 10, Windows 8 or Windows 7 are the same.

Steps to edit hosts in Windows 10/8/7:

  1. Press the Windows key or Start menu on your computer
  2. Search for Notepad or any other text editor
  3. Right-click on Notepad and Run as Administrator
    notepad run as administrator
  4. Click on File > Open and paste c:\Windows\System32\Drivers\etc\hosts
  5. Add/remove the entries 

For example:       # source server         # x client host

While updating the hosts file, keep in mind these points.

  • Do not add # on the start of the line that you are adding. This comments out the entry.
  • The IP address is placed first followed by the respective hostname
  • The IP address and the hostname in the entry should be separated by at least one space

Read also: How to unzip files without WinZip

Why we modify the hosts file? What is the significance of the hosts file?

Let me explain. 

The Windows hosts file contains the mapping between the hostname and an IP address. 

If you try to connect to any hostname over a network, Windows connects to the IP address, specified in the hosts file. Each time a request is made, Windows looks for the hosts file mapping in the System32 folder.

That’s all on how to edit hosts file in Windows.

Happy learning 🙂

Please follow and like us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top