how to edit the 'hosts'-file
I tried to edit the 'hosts' file in 'system32\drivers\etc\' folder, but windows says I don't have the rights to do that although I have administrator right. How can I edit and save the 'hosts'-file? I need that for the fast access in my intranet.
January 20th, 2009 10:44pm

Copy and paste to a different location, then edit.
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2009 10:51pm

O.K. but how can I bring it back to it's original place???
January 20th, 2009 10:54pm

Right click on Notepad and pick Run as administrator. Click on File then Open then browse to\windows\system32\drivers\etcIn the drop down list change Text files (*.txt) to All files (*.*)Open the hosts file and edit away :-)Kerry Brown MS-MVP - Windows Desktop Experience
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2009 11:38pm

Hi Bobo, Navigate toC:\Windows\System32\drivers\etc folder. There right click on the hosts file and go to properties > Security. Click on the Edit Button > Add Button and enter the name of user [Your login ID or other ID] and OK. You will be back in the Permissions for hosts window. There by default the added user will be having Read & execute and Read permissions allowed. You click on the Full Control and click on the OK button. Now you are edit the same file using Notepad. Hope this helps :)
January 28th, 2009 11:20am

GSrivathsa said: Hi Bobo, Navigate toC:\Windows\System32\drivers\etc folder. There right click on the hosts file and go to properties > Security. Click on the Edit Button > Add Button and enter the name of user [Your login ID or other ID] and OK. You will be back in the Permissions for hosts window. There by default the added user will be having Read & execute and Read permissions allowed. You click on the Full Control and click on the OK button. Now you are edit the same file using Notepad. Hope this helps :) This is a bad idea as it permanently changes the ACLs for the host file which may allow a malicious program to edit the file. You should change the permissions back once the file is edited or better yet don't change the permissions to start with but run notepad elevated as I already posted. Kerry Brown MS-MVP - Windows Desktop Experience
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2009 5:54pm

You are 1000% right, never permanently change permissions on files such as Hosts. Running as an admin is always the way to go.
April 29th, 2011 2:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics