How to edit the Hosts file in Windows 10

There are many ways to change the records of the Hosts file in Windows 10. This is mainly because the file is located in the Windows folder and therefore you will need to have administrator rights to edit it directly in its folder.

In Windows 10, the Hosts file is located at the following location:

C:\Windows\System32\Drivers\etc

Copy the hosts file to the desktop, and then open it with notepad.

How to edit the Hosts file in Windows 10

To add a new record, go to the last row and add it according to the example below.

XXX.XXX.XXX.XXX hostname

Where XXX.XXX.XXX.XXX type the IPv4 IP address and then in hostname enter the domain name of a website or the hostname of a computer.

How to edit the Hosts file in Windows 10

For example, to let a Windows 10 computer find my new Hyper-V host, I just added the following entry.

10.0.0.100 HV01

After you save the new Hosts file to the desktop, move it back to its folder by replacing the previous file.

How to edit the Hosts file in Windows 10

Note: The Hosts file does not have a file extension. If the notepad prompts you to save the file as Hosts.txt, you will need to remove the extension to work.

That’s it!

Of course, if you use Notepad++ on your computer, you can directly edit the Hosts file through its folder (edit with Notepad++), and when you are going to save it you will be prompted to so it with administrator privileges. Undoubtedly, this is an easier and quicker process.

About Dimitris Tonias 144 Articles
My name is Dimitris Tonias, IT Pro, G(r)eek, focused on Server, Virtualization, and Cloud technologies.

Be the first to comment

Leave a Reply

Your email address will not be published.


*