none
Editing the hosts file in 64 bit Windows 7 does not redirect. There is a 2nd hosts file, but even administrator cannot update it!?

    Question

  • Hi

    I am trying to redirect using my hosts file but under Windows 7 64 bit I have 2 hosts files, not in the wow64 folder as i expected but one in  C:\Windows\System32\drivers\etc as expected, but the other in  C:\Windows\winsxs\amd64_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_6079f415110c0210 

    I can edit the "normal" one as administrator, but adding a line such as this:

    127.0.0.1        test.com

    does not redirect a ping request.  

    I tried to edit the hosts file in winsxs, but even as administrator I cannot write to it (or delete it, rename it, etc).  It is owned by SYSTEM and even as an administrator, I cannot change its properties at all.

    Is there a special way to add a local redirect in the 64 bit version of windows?

     

    TIA

    Shaun 

    Monday, August 30, 2010 6:48 PM

Answers

  • Hi Shaun,

     

    By default we do not have permissions to modify the hosts file in Windows 7. The following steps are needed.

     

    1. Browse to Start -> All Programs -> Accessories

    2. Right click "Notepad" and select "Run as administrator"

    3. Click "Continue" on the UAC prompt

    4. Click File -> Open

    5. Browse to "C:\Windows\System32\Drivers\etc"

    6. Change the file filter drop down box from "Text Documents (*.txt)" to "All Files (*.*)"

    7. Select "hosts" and click "Open"

     

    8. Make the needed changes and close Notepad.  Save when prompted.

     

    Regards,

     

    Sabrina

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, September 01, 2010 9:39 AM

All replies

  • You do not mess around in the winsxs folder that is for system access only.

    How did you edit the host file?? Most folks make the mistake of using word or some such app.

    Use only a text editor and make sure you save without an exten... do not use save as.

    you must run notepad as administrator.

     

     

    Monday, August 30, 2010 7:00 PM
  • Hi Shaun,

     

    By default we do not have permissions to modify the hosts file in Windows 7. The following steps are needed.

     

    1. Browse to Start -> All Programs -> Accessories

    2. Right click "Notepad" and select "Run as administrator"

    3. Click "Continue" on the UAC prompt

    4. Click File -> Open

    5. Browse to "C:\Windows\System32\Drivers\etc"

    6. Change the file filter drop down box from "Text Documents (*.txt)" to "All Files (*.*)"

    7. Select "hosts" and click "Open"

     

    8. Make the needed changes and close Notepad.  Save when prompted.

     

    Regards,

     

    Sabrina

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, September 01, 2010 9:39 AM
  • I seem to be having the following issue, I have tried all of the above. Change permissions but yet it will still not let me save changes. I run Spybot S&D and have seen that it has updated the host but I cannot add my own. any other advise please would be great .

     

    Thanks

    Sunday, October 23, 2011 11:50 PM
  • There is only one hosts file used by Windows which is found under C:\Windows\System32\drivers\etc .  Or if you have installed Windows in
    a nonstandard location: %SYSTEMROOT%\System32\drivers\etc .

    All other hosts files are not honoured by the Windows TCP/IP stack.
    To edit this file you need Administrator privileges.


    Wolfgang
    Monday, October 24, 2011 5:33 PM
  • Wolfgang,

    I think you need to tell the Original Poster's and My machine that it should not honour the hosts file buried in winsxs.  I have the exact same issue.  My machine is ignoring the hosts file in the \system32\drivers\etc folder completely.

    Friday, October 28, 2011 7:30 PM
  • Dose not work for me at all.

    I run note pad as administrator - still get access denied.
    I can not change ownership or permissions of the file or the folder, even when antivirus is turned off.
    Even running in safe mode did not help.
    Friday, June 15, 2012 7:06 PM
  • paulg3 wrote:

    Dose not work for me at all.

    I run note pad as administrator - still get access denied.
    I can not change ownership or permissions of the file or the folder,
    even when antivirus is turned off.  Even running in safe mode did not
    help.

    What is the error message you get, if you try to change the file
    ownership? You may need to go upwards in the directory structure to get
    ownership and file acess rights and you need to be member of the local
    administrators group to take over file ownership.


    Wolfgang
    Monday, June 18, 2012 5:40 PM