Possible Duplicate:
How do you edit hosts file on Windows 7

I need to edit the hosts file so that I could restrict some sites from opening. I have tried to open it and edit it but when I save it, Admin privileges error is displayed. Even with admin privileges it doesn't allow me to edit it.


Microsoft has posted a workaround in a support article, "Modify the Hosts file or the Lmhosts file in Windows Vista and Windows 7".

|improve this answer|||||
  • 1
    I've just edited Karan's answer to clarify that despite the unfortunate title, this is a link to a workaround, not to an article claiming it simply can't be done. – Nicole Hamilton Sep 12 '12 at 18:42
  • Ugh, yes, the article provides a workaround. The title is to be interpreted not as "you cannot do it", but as "you cannot do it normally, so here's how". Also, thanks for the edit, Nicole! :) – Karan Sep 12 '12 at 18:46
  • cool, just a thought, you can create the link to say anything you want of course. Might be a good idea to just change the link text :) – JoshP Sep 12 '12 at 18:46
  • @Josh: Yep, I know that. Was in a bit of a hurry and so it actually just failed to occur to me that the original title could be misinterpreted. Will be more careful in future. – Karan Sep 12 '12 at 18:49

Open up Notepad with Administrator rights. Then open hosts file with Notepad and you can edit and save it.

|improve this answer|||||

Run your editor as administrator. That way it has permissions to write to the file.

Alternatively: Edit the file, save it in an alternative place and copy ot as administrator.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.