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 hosts file is one of several system facilities that assists in addressing network nodes in a computer network. Sometimes you might want to edit the host file for adding IP address or changing the existing ones.
The host file in Windows is located at C:\Windows\System32\drivers\etc where C drive is the location where you have installed Windows.
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.