Home » Computer Repair » Windows 7 Hosts File Ignored

Windows 7 Hosts File Ignored

IWindows 7 has easily been the best version of the operating system to date, by far. While Vista came with plenty of quirks, Microsoft seems to have learned from the mistakes made and corrected many of them for their release of 7. Unfortunately, nothing is perfect, and the odd quirk where Windows 7 ignores its hosts file is a good example of this. Fortunately for all of us – it’s easy to fix.

Description of problem:

Any custom entries in the Windows 7 hosts file get ignored. If, for example, you had “ activate.adobe.com” put in there (we’ll ignore just why you might have that entry in there.. :) ) and then tried to ping that address, it would still reply with its actual IP instead of as it should.

How to fix the Windows 7 hosts file:

windows 7 host file ignored

How to Open Notepad as an administrator in Windows 7

1. First, in order to do any editing on the Windows 7 hosts file, you will need to open up Notepad as an administrator. To do this, Click on the Start button->Accessories, and then right-click on Notepad. A context menu will appear, then click on “Run as Administrator”

2. In Notepad, open up the hosts file located at C:WindowsSystem32driversetc. You’ll need to  change the filter from “Text Documents (*.txt)” to “All Files” in order to see hosts listed.

3. Select all of the contents in the file (CTRL+A), copy them (CTRL+C), open up another instance  of Notepad, and then paste the contents into the newly opened program. Close the Notepad you have the hosts file open in.

4. Now, rather counter-intuitively, you need to delete the original copy of the hosts file. Open up Windows Explorer (Start->Accessories->Windows Explorer), navigate to C:WindowsSystem32driversetc, and delete it. Windows will likely complain about it being a system file, etc – just ignore all that and proceed with the deletion.

5. In the Notepad you still have open, click “Save As” from the file menu, change the filter to “All Files”, type “hosts” into the file name textbox, and save it. Be sure to save it into the directory where you deleted the hosts file from originally, or else it won’t do any good.

6. TEST – This is easy enough to do. If you’re reading this then you likely already to know how to do this, but I’ll humor you anyway. Open up a command prompt and type “Ping WhatEverEntryYourRerouting.com” then press enter. Using the example above, then if you were to type “ping activate.adobe.com” then you should get four replies from

Why was the Windows 7 hosts file not working?

windows 7 host file

Windows 7 Hosts File Doesn’t Work

I have utterly no idea. I’d suspect some sort of corruption with it, but since it opens properly in Notepad without any odd artifacts showing it’s hard to tell. There’s always a possibility that there are some non-standard whitespace characters in the original copy of the hosts file that don’t get brought over when the contents are copied and pasted, but who knows. I’ve tried just cutting the contents from the file and pasting them back in, followed by saving the file but for some reason it only works when the original is deleted and a new one is saved.

On a side note, you may be interested in the SmartPCFixer, which fixes windows errors and optimizes your computer.  SmartPCFixer identifies your PC problem(s) in around 2 minutes. SmartPCFixer also increases your PCs speed, performance, improve startup times and improve stability.  Check them out.

About Kevin Souter

Kevin Souter is a full time computer technician and operates a computer repair site, as well as a free spyware removal site. http://www.tweaksforgeeks.com has articles and tutorials on all sorts of computer problems from internet issues to hardware defects, for the novice and the expert.


  1. THANK YOU!! I’ve been struggling trying to get the hosts file to work in my new Windows 7 computer for about a week now. I tried changing the spacing from a single space to tabs, pasting in the hosts file from my old XP computer, etc to no avail. This is the only thing that got the hosts file working for me!

  2. I’m soooo thankful!!!! I was struggling with the hosts file since my Windows 7 got updated two nights ago with the new SP1. I was completely out of ideas until I luckily ended up here. Just by duplicating the hosts file, deleting the old one, and renaming the new one, it worked again as before. Sometimes the simplest solutions are the good ones.

    Thanks again. I mean it! :)

  3. Well at least this fix was easy. I was going CRAZY trying to figure out why Win7’s hosts file wasn’t working, when the exact same one worked just fine for me in XP and Vista.

  4. We only wasted two hours instead of eight. You are a god. Thank-you.

  5. WOW! This simple step FINALLY allowed me to see my development site. Thanks for taking the time to write this!

  6. I tried this, along with all other “fixes” I’ve been able to find…nothing seems to fix this issue for me…Any other ideas?


  7. I’ve been struggling with this for weeks.
    thanks so much. it works now. :)

  8. Oh man, FINALLY! I’ve been working around Adobe’s stupid activation for a while now due to some licensing issues that are taking forever to resolve. I can’t believe that’s all it took to get Windows 7 to actually USE the hosts file!

  9. 2 ways to fix the problem :
    first one
    1- right click – properties – security
    2- check write permission

    second one
    1-download windows 7 manager-15 days no limit fully working
    2-install it
    3-run the program and then go to IE manager tab
    there you can edit the host file

  10. Thanks man .. it worked like a charm, so solved my oldest problem on windows 7 ::)

  11. Still an issue on my end. This fix successfully returns pings from but it all browsers are still unable to resolve the domain. Anybody else get around this?

  12. Hello guys,i did what you said but i still have the same problem!!!

  13. So the problem: On initial install, the Windows 7 hosts file is a symlink to another location. Unfortunately, Windows 7 sees this as a security threat and, as a result, ignores it.

    The simple solution is to just open the file, copy its contents, remove the link, and recreate a real file in its place.

  14. The use of the HOSTS file is also affected by whether or not the Windows 7 machine is a member of a domain.

  15. I’m from the fedora linux world, so note-pad was confusing reL how to get it to not save as hosts.txt (which is not detectable by looking at the name as it appears in windows nautilus-like program confusingly called “windows explorer”. However properties window revals actual name is hosts.txt

    Work-around: When saving the hosts file, use “file -> save as” with the following:
    1. Filter set to All Files (not as txt/text file)
    2. must call it “hosts.” (calling it hosts makes notepad call it hosts.txt)

    Now I can ping the webserver running on my LAN!

  16. Tried the above and the ‘ping’ does not show as you mentioned

  17. Works great. Thanks for sharing! I’m happy to let the mystery be as long as I can fix it.

  18. I have to admit…. I smirked when I read that all I needed to do was delete the original and replace it with a copy.
    I looked in disbelief when my ping returned successful.

    Thanks !!!

  19. Having the same problem.. what fixed it for me was setting the system attribute. Run this command from an “Administrator: Command Prompt”:

    ATTRIB +S %SystemRoot%System32driversetchosts

  20. Thanks mi amigo! Only one solution that worked for me!

  21. Lol @ the adobe line… never seen that before. ;) But thanks for this – I have some servers that have a different IP in-network than what my DNS gives me, which points to the router, haha.

  22. yeah,it worked,this is the only way work for me

  23. why not just copy a hosts file from anothere computer after remove it’s read-only properties?

  24. Does not work for me, unfortunately. Windows still ignores the hosts file.

    One thing I noticed, in step 5 above:

    “5. In the Notepad you still have open, click “Save As” from the file menu, change the filter to “All Files”, type “hosts” into the file name textbox, and save it.”

    When I do this, Windows insists on saving the file with a .txt extension.

  25. One thing that trip me up…

    ‘nslookup’ doesn’t look at the host file. So I *thought* the host file was being ignored but it wasn’t.

  26. still doesn’t work for me :( it’s soooo annoying
    win 7 pro 64bit

  27. Yeah, I gave up…nothing seemed to work for me either
    Win 7 pro 64bit

  28. The real solution is to open a command window in Supervisor mode and run
    ipconfig /flushdns
    after you have updated the file.

    This clears the DNS cache and forces the system to use the new hosts file instead of its cached version.

    I keep several versions of the hosts file on my system. I have batch files that rename them as needed and run the above line. On Win 7, I just have to remember to run it in Sup mode.

  29. Just upgraded to Windows 7 Enterprise. Performed all the steps here (several times over just to be sure). Ping times out every single time–no luck. Suggestions?

    • Did you make sure that when you’re saving the new hosts file that it’s not saving with a .txt extension? Unless you make a point to select All Files (*.*) in the Save as type dropdown then Notepad will append .txt to the file you save by default. Even if you give it another extension, say “whatever.bat”, would be saved as “whatever.bat.txt” if All Files (*.*) isn’t selected.

      Screenshot of the selection that needs to be made:

      How to save the Windows 7 HOSTS file without a file extension

  30. Actually I’m not sure deleting files is necessary.

    For me the step that got it working was pinging from the command line. This seemed to flush whatever needed flushing.

  31. I have been told that if you edit the hosts file, you must always place the cursor on the last line and press enter then save it

  32. I followed the steps and deleted the hosts orginal file but the new one will only save as a text file – help!

  33. What I did, and it seems to work is this. I could not get the host file lost its attributes as a .txt file. I ran the cmd as admin and simply ran copy hosts.txt hosts then deleted the .txt file and it worked fine.

  34. Can we just knock off the .txt on the file? That’s all the hosts file is – a text doc without the extension.

    quoting Steverino:

    Does not work for me, unfortunately. Windows still ignores the hosts file.

    One thing I noticed, in step 5 above:

    “5. In the Notepad you still have open, click “Save As” from the file menu, change the filter to “All Files”, type “hosts” into the file name textbox, and save it.”

    When I do this, Windows insists on saving the file with a .txt extension.

  35. @ Kevin Souter

    Yes, that is what I did, but it still appended the .txt extension. Renaming the file to “hosts” without the extension, keeps the file intact and it is working.

  36. Make sure that you have the “Hide extensions of known file types” cleared in the folder option menu. Otherwise, when you save the file in Notepad, it will automatically append the .txt file extension and you will never know it. A hosts file with a .txt extension will be ignored by the system.

    • This is correct, although if you make sure to select “All files (*.*)” in the “Save as type” dropdown when saving the file with Notepad then it shouldn’t be an issue and the file will save without any extension, which is what you want.

  37. I need help doing:

    “I missed the opt-in for migration from the Yahoo! Delicious and now can’t find my account. What do I do?.

    To those interested in accessing your old data, there’s a trick. You can edit your hosts file and add the following entries to it:” http://www.delicious.com secure.delicious.com static.delicious.com

  38. thank god! thank you so much problem solved.

  39. I got it working, but hit a few minor bumps:

    Although I did change the txt to allfiles, I didn’t use the quotations, so it still saved as a text until I resaved it yet again – this time with the quotes; so many sites say to paste something “without the quotes” that it’s second nature, oops LOL.

    My ping of adobe failed also, but the hosts file I’m using didn’t have adobe in it, duh! So after I copied one of the blocked sites from the hosts I’m using, perfection!


  40. theres a way to edit the hosts file within command prompt it was my solution to this problem but now that im on a new system i dont remember how it was to do that -_-

  41. Hello Kevin,

    I really need help. I am using Windows 7 Ultimate x64 and I can’t find the host file on the system32/drivers/etc folder. It only have hosts.bak and if I edit it to ignore a host, it doesn’t work. Please help!

  42. Thanks a lot!

  43. Guys,
    I log to win 7 but I try to save changes inside the hostfile but the system tell me that I dont have permissions although am adminstrator….?????
    plz help me

  44. Guys,
    I log to win 7 but I try to save changes inside the hostfile but the system tell me that I dont have permissions although am adminstrator….?????
    plz help me

  45. And always remember to backup your Hosts file.
    …just in case you make a mistake somewhere along the way

  46. thanks a lot ! I have had the same problem, the hosts file work now (on windows seven)

  47. Very timely post, I have been having this issue for a few days now and finally got round to trying to fix it, this worked!

    Many Thanks


  48. Thank you! It worked. That’s just crazy.

  49. thanks a lot. Regarding the hosts file. It usually contains the “example” line you used above adobe.activate.com and a list of other lines related to adobe as well. Is that 1 line enough or i need to use the long hosts i’m finding all over the net? I’m using CS5 and 4 at the same time. plz help

  50. I had following lines in the hostfile wiki, wiki.testdomain

    turned out, I could not “ping wiki”, even after your tipp

    But I could “Ping wiki.testdomain”.

    So I changed the lines to wiki.testdomain wiki

    now both work

  51. erm, weird i dont have a ETC folder in my drivers folder and not HOSTS file at all.

  52. Thanks that workeD like a HELL ! u have a beer from me :P

  53. Thank you this has been a big help

  54. This has been driving me nuts for the last 2 hours. thanks!

  55. Thank you thank you thank you!

  56. Thank you Don!!! Your system attribute tweak was also required on my system.

    Run this command from an “Administrator: Command Prompt”:
    ATTRIB +S %SystemRoot%System32driversetchosts

  57. THANK YOU!!!! SENSEI!!

  58. thanks……………

  59. The hosts file can sometime’s be a bit of a pain. the worst i have had it is where you can’t delete it but found a way round that as well just use a shredder that seems to do the trick.

  60. This is the problem with Windows. There are a lot of bugs that even their own updates to supposedly fix these bugs actually have problems. It would have been better though because of the number of resources.

  61. @Crolma above was key to making my file work. Thank you so much! XOXOXO!!!

  62. I have tweaked the hosts file and all but one of the entries are working, when i ping the address it picks up the correct IP but doesnt display the correct site any ideas?

  63. “ping activate.adobe.com” -> Hahaha. So that is why it is used for :p

    I suspect it’s related to encoding. When using Notepad, by default, it uses ANSI…

  64. thanx very much

  65. Hey I did this, worked, then a few days later stopped again.
    So make sure you check. I thought it was Search and Destroy Spyware software, but that is uninstalled now and it still keeps going back to ignoring it.

  66. My problem is a little different. In XP I used to have an entry in the host file like this: admin tech met

    which could access 3 different virtual web-servers on the same IP. Worked fine under XP, but Win7 seems not to read the hosts file at all.

  67. I stuggled a lot with this. What solved it for me was to just clicking on the hosts file name in the etc folder and deleting the extension (kind of renaming the file). The system would complain that the file would be unusable but just ignore it.

  68. This is great, just exactly what I needed to learn

  69. I was able to ping my localhost which worked but I was unable to access it through my browser (chrome).

    Strangely enough it worked in Firefox, so I guess chrome is caching it somehow.

    I presume it will work in chrome as well once I restart my computer.

  70. This article is inaccurate. It has nothing to do with Windows 7 or with deleting/saving.

    It is because you have to provide a line terminator to every line. As long as you have a blank line at the end of the document, it will work fine (and has ALWAYS been the case).

    I bet, anyone at stack could have given this a correct answer. Instead you write a garbage article, don’t understand the problem, and try to gain some ad revenue.


    • I have to disagree. I actually tried StackOverflow when I first had the issue, tried adding the carriage return to each line manually, etc and it didn’t work. Also tried using one space between the url and ip, a tab between, etc with no luck. It wasn’t until I completely deleted the file [after copying the contents] and then re-saved it as a new file that it functioned. If it’s a terminator issue, then explain why deleting the file and then pasting in the EXACT SAME contents then works. I’d actually love a legit explanation to why this happens.

  71. Ok, saw something very odd when doing this. Normally I edit the hosts file with Wordpad, and this has worked perfectly no problem for literally years. Then, I noticed that the hosts file was being ignored. Having bounce my head off a few other reasonable suggestions, I tried this and saw something very odd. When I opened up the hosts file with Notepad I saw that every line had “par” appended to it. Also, the top line had a path in brackets on top. Quite obviously the file had become corrupted in some way that Wordpad couldn’t see. Deleting the weird path and all of the “par” appendices did it.

  72. Awesome ! Thank you for such wonderful tip


    I am still sane in spite of MS! Another day of my life wasted. Microsoft has wasted more of my life than any other cause.

  74. I had to DELETE THE TXT EXTENSION via window explorer. It then worked perfectly!!

  75. Thank you, thank you, thank you!!!
    Now my soul is free!!! XD

  76. Edit the hosts file in notepad as Administrator. Highlight the white space between each IP and hostname and replace it with a or two. Just get the characters out of there. This fixed it for me and I was at the point of throwing my PC against the wall after trying everything else and nothing fixing this issue for me.

  77. Silly text box formatting… replace the (SPACE) characters with a (TAB) or two is what that should read as.

  78. Thank you DumbArticle. I couldn’t get my hosts file to work properly. I did not know about the blank line requirement at the end of the hosts file. All I did was add the blank line and it worked great.

  79. After trying many different suggested solutions, I checked the security on the ‘etc’ folder and compared its permissions to that of the ‘es-ES’ folder, and found that the group Users did not have Read & execute rights like they did on the other. After taking ownership (again) of the ‘etc’ folder, I granted group Users Read & execute permissions, and had them inherited by the folder contents. That fixed the problem for me–whatever part of the system queries the hosts file evidently is under the restrictions of the User group. I must have removed the group’s permissions accidentally at some point when trying to modify the hosts file.

  80. open a cmd prompt, navigate to the hosts file directory. type “dir” and you see hosts.txt. type “rename hosts.txt hosts” and hit enter. Then do an ipconfig /flushdns.

  81. great Work!
    I spend 2 Days with searching why windows doesn’t get the entries in the hosts-file.

  82. even changing the pull down on bottom to all files it still saves as hosts.txt n you need to remove the .txt ‘weird is one time it did save without extention but next it didnt and ;i redid again n for sure pulled down to all files but it added txt anyway

  83. So, I believe I have discovered the root cause of this bug.

    At least in my case (but I imagine *many* others too) it’s an encoding issue.


    tl;dr. Your text editor uses Unicode/saves as Unicode. Windows expects ASCII – ensure your output encoding is set to ASCII.

  84. Thanks, that worked…

  85. Corruption in the hosts file? You’ve been on a Mac for too long.

  86. thanku..to give me detail for host file.

  87. I just ran into this in WIndows 2003 server.
    After reading this post I took a look at my hosts file through vi (I cygwin running a Unix shell on the server) and while I still could not see what was wrong with the file it did tell me at the bottom that the file was incomplete. Somehow it was corrupted.
    I recreated a new one, ran ipconfig /flushdns and tried pinging my desired host and finally got back the correct IP!

  88. What happened for me was the permissions on the HOSTS file itself. It did not include “Users:Read” or “Everyone:Read”. This occurred because I had made a copy of the HOSTS file in another directory, edited it, then copied it back. When I copied it back (from my elevated command prompt), it was created with permissions such that only Administrators could read it.

    It may be that since you saved the file with a non-elevated Notepad window that the permissions included Users or Everyone.

  89. to make it nice and simple…open existing hosts file with notepad, make required changes, save to your desktop (or elsewhere) as “hosts.txt” (without quotation marks). Delete (or rename existing hosts file in windows/systems32/drivers/etc) and copy new hosts file from where you saved it. Change file name from “hosts.txt” to “hosts”. Note that you will need to in your administrator login in order to perform above steps. Takes about 2 mins… :)

  90. you are amazzingggg

  91. I was struggling with all the given solutions thanks a ton for your valuable advise

  92. Either this worked, or the commenter about registering it as a system file worked – either way i’m back with a working hosts file! Many thanks!

  93. Of course “activate.adobe.com” won’t work, you have it backwards; the IP address must *precede* the domain name: activate.adobe.com

  94. Thanks, this worked correctly. Thanks

  95. Finally got it working on Vista. Most likely, the resolution was to do saving the file using ANSI encoding. Thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>