Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to edit the hosts file (C:\Windows\System32\drivers\etc\hosts), because I want to setup a local redirect for my website (like I've always done in XP). However, I can't save the changes!

I have taken ownership, I have allowed my account full access and have tweaked every other setting I can think of. Every time I edit and save it, "Access is denied" pops up.

How do I get past this?

share|improve this question

migrated from Sep 30 '09 at 17:24

This question came from our site for professional and enthusiast programmers.

up vote 16 down vote accepted

You have to open it with administrative access.

Launch Notepad with Administrative access then re-open the file.

share|improve this answer
You should accept this answer @Keith Barrows – Kyle Mar 24 '11 at 9:40
I just noticed that Avira Antivirus includes protection to avoid modification of system files, you should disable the realtime protection before attempting to save the file and enable it afterward. – jhcaiced Jul 29 '14 at 13:56

run notepad as administrator by right-clicking on a shortcut to notepad, and then opening the hosts file.

share|improve this answer


  1. Sometimes we need to modify hosts file to achieve your goals. XP OS supports saving it after modify directly. But on Windows 7 OS it prompts you have no permission to modify it.

  2. Open this file in local path c:\windows\system32\drivers\etc.

  3. Then right click on it, select properties option.

  4. In the opened host properties, switch to “Security” tab.

  5. Then click Advanced button.

  6. In the opened window, we select “Change permissions” button.

  7. Check out “Include inheritable permissions from this object’s parent” option, then click Add button.

  8. After click Add button we back to the previous window, click confirm, pops up Windows safe window, click Yes.

  9. Click confirm again, back to host properties window, then we select Administrators and click edit button.

  10. We checked the current user’s management group, to give full control permissions.

  11. Click confirm button, then we can modify hosts file now.

can refer to the link:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .