The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file and is conventionally named hosts. The host file is one of several system facilities that assist in addressing network nodes in a computer network. Sometimes you might want to edit the hosts file for adding IP addresses or changing the existing ones. Here is how to edit Hosts File in Windows 11.
How to Edit Hosts File in Windows 11:
The host file in Windows 11 is located at C:\Windows\System32\drivers\etc where C drive is the location where you have installed Windows. Here the basic assumption is that Windows is installed on your C drive. If it is installed on any other drive, make sure you make the changes in the path mentioned above.
If you open and edit the hosts file, you will not be able to make changes to this file in this folder. You can open the hosts file using a notepad or TextPad, but unless you have administrator rights, you will not be able to edit it.
You get a message while saving it saying you do not have permission to save in this location.
So if you want to edit the host file, make sure you take a backup of this file elsewhere and then go to the start menu and search notepad. In the search result, right-click on the notepad icon and select Run as administrator.
This will open Notepad in admin mode, now browse for the hosts file using the file menu and open it. Once you have made the changes you can now save it in the same location as notepad is running in administrator mode.
Please note that before making changes to host file, please take a backup of this file, so that in case you mess up with any file, you can restore it back.