These instructions are valid for all versions of Windows, from Windows XP up through Windows 10.
To still use the file you've edited, go ahead and save it to your Desktop or some other folder, and then go to that folder, copy the HOSTS file, and paste it directly into the location where the HOSTS file be, as described above.
Right click the "Notepad" icon and select the "Run as administrator option as shown in the screenshot below.
The user account control dialog will then pop up and ask you if you want to run notepad as administrator.
I can't do a screenshot of this, but click the "Continue" button and then notepad will start.
You can then edit and save the hosts file with no issues.
Then, saving the HOSTS file over the original can be performed without having to verify your admin credentials.
The hosts file contains a list of IP address to hostname mappings and can be useful especially for web developers if they need to point a hostname to a specific IP address while developing or testing a website, without having to change settings on a DNS server.Windows Vista hosts File Location: C:\Windows\System32\drivers\etc\hosts If you want to add a custom DNS entry say to a printer on your network you would add a line similar to the below which would allow you to reach the printer by simply typing printer.Windows Vista hosts File With Addition: I used Notepad to modify the file though it can be done with the default notepad application installed on Windows Vista.Editing the HOSTS file might come in handy if you want to make custom domain redirects, block websites, or remove malicious entries set by malware. However, you might run into problems when trying to make changes to this file in some versions of Windows.This is most likely due to permission issues; there's an explanation on how to bypass that below.