Windows7 will not let me edit the hosts file and save it

Anonymous
2010-04-16T18:31:57+00:00

Windows7 will not let me edit the hosts file and save it. What must I do in order to save the edited host file?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2010-04-16T18:47:57+00:00

It's a built-in safety feature.  There is an easy workaround.  ClickStart ->All Programs -> Accessories.  Right-clickNotepad, and then click Run as administrator.  If you are prompted for an administrator password or for a confirmation, type the password, or clickAllow or Yes.

Open the Hosts file (from the notepad you just opened) , make your changes, and then click File ->Save

Barbara

Was this answer helpful?

200+ people found this answer helpful.
0 comments No comments
Answer accepted by question author
Anonymous
2010-04-16T20:43:01+00:00

You need to either take ownership of the file (Right click the hosts file, Security tab, and give yourself full rights), or open Notepad as Administrator and open, edit and save your hosts file from there. It's designed that way so some rogue malware can't come in and change that.

Was this answer helpful?

70+ people found this answer helpful.
0 comments No comments

66 additional answers

Sort by: Oldest
  1. Anonymous
    2012-08-08T01:25:45+00:00

    It also helps if you can follow the path to: C://Windows/System32/drivers/etc

    Find the host file and right click "Properties" the select "Security" tab.

    Select the Group or Username that has full control privileges on your machine. There should be a list of users in the box.

    Click on "Advanced" button and select from the "Permissions entries" the administrator that has full control privileges and then select the "Owner" tab. Select the "edit" button and then choose the owner to take control of that file.

    Click "ok." Next, from the same box, choose "Effective Permissions" tab and then click "Select." Go to the "Advance" button and then click "Find now" button. Select the administrator in the search results box that you want to give full control to if administrator doesn't have it as indicated by all the check marks.

    Click "ok." If the check marks are not automatically populated then making sure that you have selected the administrator that you want to give full control privileges to under the "security" tab, manually check ( or click to add check marks) all full control and writes privileges for that administrator. Make sure you go to the "edit" box in order to make these revisions.

    Hope this helps. If you have questions, email me at ******@jaesmith.com and I will help you through this process.

    BTW, you can take ownership and control of most folders and files you are having issues with.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2012-08-08T02:00:57+00:00

    I am attaching the solution as well as the mail trail with Microsoft.

    From: Jins Joseph  

    Sent: 08 August 2012 07:05

    To: 'Microsoft Online Customer Service'

    Subject: RE: SRX1180982535ID - Host file issue

    Hi,

    As you would know, some of the Windows 7 users can’t save the host file how they like it. The host file itself will simply vanish what the user had done with it.

    For those users who experience this problem, here are the instructions to fix it.

    First of all, you should have the administrative privileges to edit the host file. In normal case, if an admin user directly go to the host file in system 32 and add his preferences and then save it, it should keep the changes. However, in some wicked scenarios, it will not. I had done a detailed research on this through all the available online forums and even contacted Microsoft several times with no luck.

    So, here you go with a correct solution for this problem.

    Note: If you are not comfortable with Windows OS and don’t know what you are doing, this process can mess up things. Hence, do not attempt if you are not 100% sure you can make it.

    ·         Login to an administrator account.

    ·         In the run command (Windows key + R) type, “control folders” and hit enter.

    ·         Click on the tab called view.

    ·         Select the radio button for Show hidden files, folders and drivers –ON.

    ·         Uncheck the ‘Hide extension for known file types-ON

    ·         Click on Apply and then OK.

    ·         Type “drivers” in run command and hit enter. It will take you to where the folder “drivers” located in System 32.

    ·         From the “drivers” folder, double click the folder named “etc.”

    ·         Now you can see the “host” file along with others.

    ·         Now, in the search area in start menu, type “notepad.exe” and open the notepad.exe as administrator. (In order to do this, you can right click on the notepad.exe shown and select “Run as Administrator.” If UAC prompted, click YES/OK)

    ·         Now, you will have a notepad open with administrative privileges.

    ·         At the top left side of the notepad click on “file” and then select “Open.”

    ·         A box will appear which will allow you select the file to open. Carefully, navigate to the location where the “host” file is located. To do that, select the drive where you installed Windows. If you have the Windows installed in C: select ‘Local Disk (C :)’ > Windows > System 32 > drivers > etc. At this point, you might not have another option to proceed or select from. The window would be empty. To proceed further, select the option “All files” from the drop down menu which is located above the “Open” and “Cancel” button. You can now see all the files located in etc folder.

    ·         Select “hosts” from the menu and click on “Open.” Note: You can either click on open or double click on the file.

    ·         Now, you will have the host file information open in the notepad which you had already initiated before with administrative privileges.

    ·         Make whatever changes you as you wish. (Example: If you need to block a web site called www.block123.com you can type 127.0.0.1 www.block123.com right under the local hosts. Make sure you do not change any other letters or characters which are already saved in host file. This will completely mess up your computer. For more information on the information about host file, refer the Microsoft web site: http://support.microsoft.com/kb/972034 . If you have accidently delete/edit anything from host file, please delete the complete information stored in host file and copy and paste the host file information from Microsoft which is appropriate for your Operating System.)

    ·         Click on “file” again and select “Save as” and save it in etc. If the path is showing correct to etc folder, save it to etc. If it is navigated to somewhere else, follow the instructions provided above and select etc folder and then save it.

    ·         Now, go back to the actual host file location which is in System32 > Drivers > etc (You would have it already open if you had followed the instructions just like the way I have provided)

    ·         There you can see 2 host files. One which has already been there and the other one you just saved.

    ·         Among the two, one is called “hosts” and the ‘type’ would be ‘file.’ This is the original host file. The other which you have just saved will be named as “hosts.txt” with the file type as ‘Text Document.’

    ·         Right click on the original host file and select rename. You can even click on that file and press F2. This will enable the option to rename the file. Rename the original host file as “hostold” and hit enter.

    ·         Now, select the second host file which we have saved as a text document and rename it as “hosts.” Make sure that you DELETE the .txt file extension in order to change the type “Text Document” to “File” and hit enter.

    ·         Now, you have successfully saved the host file with your preferences.

    ·         You can now delete the file which we renamed as “hostold.”

    ·         We are done. You would need to do this process all over if you need to edit the host file again. I know it is difficult, however, it is our own requirement and we have to invest few minutes on this.

    ·         Enjoy your computer with a great feeling that you have finally edited the host file as per your wish and take it from here. Wish you luck.

    Should you have any questions, please feel free to ask.

    Microsoft people, I would like to receive a reply on this from you.

    Thanks and regards,

    Jins Joseph

    From: Jins Joseph

    Sent: 06 August 2012 05:19

    To: 'Microsoft Online Customer Service'

    Subject: RE: SRX1180982535ID - Host file issue

    Hi,

    Good day..

    Never mind the previous question. I already know how to enable the built in administrator and I was just frustrated and wanted to see if you people know how.

    Finally, I found and answer to my question my own. Unfortunately, I do not have the time now to explain it how. I will draft an email when I am free with the detailed instructions.

    Looking at the online forums, I found that there are a lot of people experiencing the same issue and you people should be getting emails regarding this. Thank you for all your help, even if it didn’t help me at all!

    Keep your inbox ready to receive the step by step instructions on how to fix the host file editing issue win Windows 7, soon.

    Thanks and regards,

    Jins Joseph

    From: Jins Joseph

    Sent: 06 August 2012 04:40

    To: 'Microsoft Online Customer Service'

    Subject: RE: SRX1180982535ID - Host file issue

    Hi,

    How do I enable the real administrator account in Windows 7?

    Thanks and regards,

    Jins Joseph


    From: Microsoft Online Customer Service [mailto:******@css.one.microsoft.com]

    Sent: 02 August 2012 18:08

    To: jins joseph

    Subject: RE: SRX1180982535ID - Host file issue

    Hello Jins,

    Thank you for contacting Microsoft Customer Service.

    As a Customer Service Representative, I am here to assist you in finding the right place to get help with your questions and provide resources to resolve your concern

    If you are based in the United States I request you to call that that this no : 1-800-936-5700 and ask them to transfer your call to the department, who can assist you in your own language.

    In case you are based outside the United Staes, please note that our Support Professionals are only trained to troubleshoot issues with North American versions of our products whereas the Support Professionals at the local Microsoft subsidiaries are trained to troubleshoot issues with localized versions of our software and can assist you in your own language.

    To locate the contact options for your region please click the following link then select the appropriate product. http://support.microsoft.com/selectindex/?target=assistance

    I apologize for the inconvenience. I hope the above information is helpful to you.

    Thank you,

    Usha

    Microsoft Customer Service Representative?. Meet the new Windows Phone 7

    If you have any feedback about your Online Customer Service experience, please send it to my manager, Veerendra by clicking the link below. Please be sure to include the name of my manager in the subject field.

    http://go.microsoft.com/?linkid=9685406


    --- Original Message ---

    From : "Jins Joseph"

    Sent : Wednesday, August 01, 2012 11:56:13 PM UTC

    To : "'Microsoft Online Customer Service'"

    Subject : RE: SRX1180982535ID - Host file issue

    Hi,

    Unfortunately, I do not have the time to call and speak to a customer care representative. Also, I do not know how to speak English. Can your supervisor not get the proper answer from Microsoft on how to resolve this damn problem about editing the host file?

    I am tired of trying this and ask your supervisor to reply me with the correct answer please. I really need to edit the host file and also really do not have the time to run behind it and call again and again.

    I will be waiting for an answer on how to FIX it. Please do not send me the number to call again. That is what all I got so far..lol!

    Thank you for your help in advance.

    Thanks and regards,

    Jins Joseph 

    From: Microsoft Online Customer Service [mailto:******@css.one.microsoft.com]

    Sent: 27 July 2012 01:05

    To: jins joseph

    Subject: RE: SRX1180982535ID - Host file issue

    Hello Jins,

    Thank you for contacting Microsoft Customer Service.

    As a Customer Service Representative, I am here to assist you in finding the right place to get help with your questions and provide resources to resolve your concern

    With regards to our previous communication, I would like to inform you that the best thing to do is either contact Microsoft Technical Support as they are best equipped to address your concern in this regard. You may contact them directly at 1-800-936-5700. They are open Monday through Friday from 5am to 9pm and Saturday and Sunday from 6am to 3pm Pacific Time.

    Jins, please contact us if you have any additional customer service questions.

    Thank you,

    Steve

    Microsoft Customer Service Representative?. Meet the new Windows Phone 7

    If you have any feedback about your Online Customer Service experience, please send it to my manager, Veerendra by clicking the link below. Please be sure to include the name of my manager in the subject field.

    http://go.microsoft.com/?linkid=9685406


    --- Original Message ---

    From : "Jins Joseph"

    Sent : Wednesday, July 25, 2012 7:38:30 PM UTC

    To : "'Microsoft Online Customer Service'"

    Subject : RE: SRX1180982535ID - Host file issue

    Hi Rocky,

    Thank you for your help. However, I have already found these web sites before and attempted the suggestions given there. I even attempted it now as well. I can save the host file after editing it.

    However, when I close and open the host file, what I have saved is gone.

    Could you please forward this to your support team or the technicians at Microsoft to get a prompt answer?

    I sure know you work for a BPO and you cannot do anything more than referring me to some web sites or the Microsoft answers. However, I am sure you can help me contact your elevated support team at Microsoft. I believe, your client (Microsoft) is the only one who can help me at this point. Kindly do consider and forward my request to Microsoft.

    I suggest you not to waste time searching online for another answer since I have already wasted hours searching and performing them.

    Thanks and regards,

    Jins Joseph

    From: Microsoft Online Customer Service [mailto:******@css.one.microsoft.com]

    Sent: 25 July 2012 20:07

    To: jins joseph

    Subject: RE: SRX1180982535ID - Host file issue

    Hello Jins,

    Thank you for contacting Microsoft Customer Service.

    As a Customer Service Representative, I am here to assist you in finding the right place to get help with your questions and provide resources to resolve your concern.

    I apologize for the inconvenience caused to you. With regards to your issue, I am glad to inform you that I did a research with our Microsoft resources and found couple of links that will help you in resolving your issue. Please visit the link given to know more information on ?You cannot modify the Hosts file or the Lmhosts file in Windows Vista and Windows 7? on the following website: http://support.microsoft.com/kb/923947

    You may also visit the link given below that may help you in resolving your issue. Please visit the link given below which explain about ?Windows7 will not let me edit the hosts file and save it?:

    http://answers.microsoft.com/en-us/windows/forum/windows_7-files/windows7-will-not-let-me-edit-the-hosts-file-and/9cede7a3-1908-4606-a955-64a9b4872fd7

    I hope the above information is helpful, and please feel free to write us if you have any additional customer service questions.

    Thank you,

    Rocky

    Microsoft Customer Service Representative?. Meet the new Windows Phone 7

    If you have any feedback about your Online Customer Service experience, please send it to my manager, Veerendra by clicking the link below. Please be sure to include the name of my manager in the subject field. http://go.microsoft.com/?linkid=9685406 


    --- Original Message ---

    From : "Jins Joseph"

    Sent : Tuesday, July 24, 2012 10:10:23 PM UTC

    To : "'Microsoft Online Customer Service'"

    Subject : RE: SRX1180982535ID - Host file issue

    Hi, Usha.

    This doesn?t answer my question. I have called Microsoft several times and got no answer. Unfortunately, I cannot do that again and I would prefer the troubleshooting steps through this emai.

    Can you send me the information on how to fix this problem?

    Thanks and regards,

    Jins Joseph


    From: Microsoft Online Customer Service [mailto:******@css.one.microsoft.com]

    Sent: 25 July 2012 02:14

    To:

    Subject: RE: SRX1180982535ID - Host file issue

    Hello Jins,

    Thank you for contacting Microsoft Customer Service.

    As a Customer Service Representative, I am here to assist you in finding the right place to get help with your concerns and provide resources to answer your questions.

    I am sorry to know that you wereexperiencing issues with editing the host files. I will be glad to assist you with.

    I would like to let you know that you may also contact our Technical Support team via our Phone Support department at 1-800-936-5700 they are best equipped to address your concern. The representatives are available from Monday through Friday from 5AM to 9PM and Saturday and Sunday from 6AM to 3PM Pacific Time.

    I hope the above information is helpful, and please contact us if you have any additional customer service questions.

    Thank you,

    Usha

    Microsoft Customer Service Representative ?. Meet the new Windows Phone 7

    If you have any feedback about your Online Customer Service experience, please send it to my manager, Veerendra by clicking the link below. Please be sure to include the name of my manager in the subject field. http://go.microsoft.com/?linkid=9685406


    --- Original Message ---

    From : Jins Joseph

    Sent : Tuesday, July 24, 2012 11:34:32 AM UTC

    To : ******@css.one.microsoft.com

    Subject : Host file issue

    CUSTOMER PROVIDED SYSTEM PROPERTIES

    O/S: Windows 7 Home Premium 64 bit

    Br: IE8

    CONTACT INFORMATION

    First Name: Jins

    Last Name: Joseph

    PRODUCT

    Windows 7 Home Premium

    QUESTIONS OR COMMENTS

    Message: Hi,

    Greetings of the day.

    I am using Genuine Windows 7 Home Premium 64 bit OS and experiencing issues with editing the host file. Whenever I edit something and save it, it doesn't save the what I have done. Previously when I attempt to edit this file and save it, said I do not have the permission to save this file in ?etc? or system32 folder even though I am logged in as the administrator. Note: I am the only admin of this computer and the other 2 accounts I have is a Guest and a Standard user.

    Since it said I do not have the permission to save the edited host file in ?etc?, following are what I have tried and with no luck.

    I have given full control to the ?etc? folder as well as the host file through its Properties > Advanced > Owner and then Apply-OK. Now, when I check for the current owner, the admin account Jins Joseph (Jins Joseph-PC/JinsJoseph) is displayed. Also, when I go to edit permission, I have the full control.

    After I change the permission to the folder and the host file, I have rebooted the computer several times and I still have the full control. However, the host file just can?t save what I have done.

    Now, when I edit the file and click on file > save, it doesn't say I do not have the permission or it doesn't prompt for another location to save. This time when I edit and save the host file, the last modified date has  changed to the current time. However, it still doesn't save the file. After I close the host file and reopen it, what I have done is vanished.

    Hence, I have tried another method. I went to system32 > drivers > etc and then from start menu, I type notepad.exe and run it as administrator. I have opened the host file from there and saved it. Still after I close the file and then reopen it, it just doesn't keep what I have edited.

    I have also added a new admin called everyone in the folder permission area and gave full control. No luck there as well.

    I have sent an email to Microsoft describing this information and didn?t even get  a response. (Your customer service request # is 1178748964.)

    I believe someone can help me here. I am stuck with no further clue.

    Please help......

    Thanks in advance.

    Jins Joseph.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-10-11T07:54:50+00:00

    I tried this and it when I right clicked on the notes file in the system32/drivers/etc/hosts. A window came up after I added the change to the file in notepad. The error message still told me that I didn't have permission to make changes and asked if I wanted to add the change to a file in My Documents instead. I have tried every which way. I even used CMD to add myself as administrator and remove the security but that still didn't work. I don't know what else to do. There must be something simple that I am missing

    Was this answer helpful?

    0 comments No comments