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:
Copy the hosts file to the desktop, and then open it with notepad.
To add a new record, go to the last row and add it according to the example below.
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.
For example, to let a Windows 10 computer find my new Hyper-V host, I just added the following entry.
After you save the new Hosts file to the desktop, move it back to its folder by replacing the previous file.
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.
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.