How to edit hosts file in Windows 7 and windows 8 that require admin privilegesHosts file is a normal text file used by your operating system (windows) that is to map domain name to IP address. There are many uses with hosts file like blocking specific websites or a list, redirecting a website, assigning local domain names etc. There are also several other files in your windows computer which requires administrator privileges to edit. Here we will see how to edit hosts file in Windows 7 and Windows 8 that require administrator privileges.
At sometimes, let’s say to block a website you will need to access and edit the hosts file. In both Windows 7 and Windows 8 hosts file is located in your system root directory (%systemroot%) that is where Windows is installed. Normally you can find hosts file in C:\Windows\System32\drivers\etc.

They are system files and so the files in etc are hidden by default. To view it drop down the organize tab and
select folder and search options. Now in folder options go to view and select show hidden files, folders and drivers.

How to edit hosts file in windows 7 and 8 computers as a administrator

In etc folder you will now see 5 files such as hosts, lmhosts.sam, networks, protocol and services. Edit the hosts file using notepad and when saving file you will see a message that says “you don’t have permission to save in this location” “contact the administrator to obtain privileges”.

Editing hosts file in windows computer 7 and 8 using admin privileges

Even though you are the only user to your computer (administrator) some system files says “access denied” when you open it.  So here is the simple solution to edit hosts file and other protected files in windows computer.

Edit hosts file in Windows 7

Step 1: In your windows 7 computer click on start menu, search for “notepad”, right click and then run as administrator.

How to edit files in windows that require admin privileges

Step 2: Next in notepad navigate to file >> open, select all files and search for hosts file by navigating to C:\Windows\System32\drivers\etc.

editing hosts file in windows computer 7 and 8 - administrator privileges

Now you can make changes to your hosts file and save it in the same folder.

Edit hosts file in Windows 8

In windows 8 press the windows key, search for notepad and click on run as administrator. Now search for the hosts file and edit it. You can also use Notepad ++ to edit hosts file.

How to edit host files in windows 7 and windows 8 computer


Hope this post helped you to edit hosts file in both windows 7 and windows 8 computers.