Jan 212009

This may sound silly suggestion to even post on Windows Reference but will help avoid some annoyance with Windows Vista and Windows 7. The host file is the one where one enters hostname and IP Address pair manually as against being served by a Name server (ex: DNS). As always the “host” file is under C:\windows\system32\drivers\etc\ or %systemroot%\system32\drivers\etc\ and hence cannot be edited by normal users.

To edit the host file,

Click Start – search for “Notepad“, right-click and select “Run as Administrator“. This should launch notepad with elevated privileges. Now, open the host file from the File menu, edit and save.

This should help!!!


Windows 7 Essential Training – Free Video Training Tutorials

Incoming search terms:

  250 Responses to “Edit hosts file in Windows 7 & Windows Vista”

  1. your are god! thanks!

  2. Thanks for this. You made my day! :)

  3. yeah i also try different step.. like creating shortcut in note pad to host file and run as administrator..same problem i got.. i did changed host file and save..but another hosts file appear in a different property.. i check the original file nothing has changed..

  4. ok!!!! finally i figure it out!!! heres what i did and it works great!! just go to hosts file right click property and uncheck readonly , then open note pad run as administrator and edit host file and save!! i did that i my cs4 after generating key. close the cs4 and do the editting in hosts file,, then after, dont forget to check again the read only file option.. i reffer to disconnect the enternet before doing it.. thats all enjoy!!!

  5. Yesss it worked!!! Thanks so much!!!

  6. I have seen the comments on where the Host files are in Windows 7. Is there a simple way to locate them ? Dimon provides details for an AMD system – but I can’t find an equivalent folder in my Intel based system. Any thoughts welcomed.

  7. Thanks so much!

  8. Worked for me.

  9. run netstat from cmd to check tcp connections once edit is done

  10. anything is your local address that you can assign bad websites DNS resolution to.

    As a side note: spybot Search and Destroy lists all the bad websites under http://www.007guard.com with the address

    So if you see it when you run netstat dont panic!

  11. Here you can read about why update of the file hosts sometimes needs special attention.

    “Because of its central role in local host resolution, the hosts file represents an attack vector for malicious software. The file can be hijacked, for example, by adware, computer viruses, trojan horse software, and may be modified to redirect traffic from an intended destination to sites hosting content that may be offensive or intrusive to the user or the user’s computer system.The widespread worm Mydoom.B blocked users from visiting sites regarding computer security and antivirus software and also affected users’ ability to access the Windows Update website. Administrators can set the file permissions of the hosts file to read-only as a means to help defend against malicious redirects caused by malicious software editing the hosts file when casual users without permissions use the computer.”

  12. Microsoft ROCKS!!! I feel so bad when people say bad things about microsoft! Apple looks like a toy, and Microsoft is the best!

  13. Give Microsoft a break! They’re awesome and make great products.

  14. Thanks! Such easy and such effectively! :)

  15. im trying to delete security tool from my cpu using malwarebytes and changing my host name to default but how do i change it to default does anyone know?

  16. Thanks, man! It really helped!

  17. Thanks you totally rock

  18. You saved my day :-D !!!
    I was about to loose my mind… A million THANKS!!!

  19. Thanks a lot! Your way to solve this problem is the best and fastest!

    +5 respect bonus points from me :)

  20. I wish I had found your tip several hours ago…it would have saved me LOADS of frustration. Thank you. It worked wonderfully and I was done in minutes.

  21. MANY MANY THANKS !!! Your idea it works! Great job man!

  22. I’ve been using HostMan up until Vista and Windows 7, as i hated making entries into the windows host file. The User Account Controls was a pain to deal with … extra screens when i simply just want to make a simple change to a text file. Anybody out there have any suggestions on Alternatives to HostMan, or alternative methods for maybe dynamically managing dns entries locally?

  23. This still does not work for me, when I try to overwrite the hosts file it tells me that this file is read only.

  24. Thanks…it does work on WIN 7

  25. Thanks mate,

  26. I changed to hosts.txt.
    What’s fomat of this file ?

  27. U have to open this path for administrator rights opened noteped to work:


    fking stupid micro&$oft

  28. there’s no format, no extension, just like this:


    if you changed it, change it back to this.

  29. just what I needed thanks!

  30. Thanks, very helpful

  31. Great it just saved my mods. Great man Thanks a lot

  32. Please for the love of all things sacred…

    - it is read only, as people keep frickin saying! just uncheck the read-only box in properties, as people keep frickin saying!

    - even if you are administrator, just rightclick > run as admin on notepad, as people keep frickin saying!

    - just file > save when done editing, as people keep frickin saying!

    All people have to do is read the article / comments, and the info is right there, but they keep asking over and over and over…..

  33. Thank you very much for this fix it helped me out alot I booked marked this page for sure, I have tried everything to get flashplayer games e.g. facebook/farmville to work for three months or better, highly recomend this site to anyone and again thanks, Tony

  34. thanks..saved some time

  35. Good One.. Thanks for sharing..
    You just helped me there!! :-)


  36. thank you, this has been running me made, it’s completely counterintuitive.

  37. Wait once I edit my host file correctly, how do I save it as a file not a (.txt) file?

  38. this was a waste of my time. The same message comes up every time. I might as well keep trying it the obvious way that doesn’t work.

  39. Hey man.. This helped me a lot! that was really simple and from month I was trying to edit it but cudnt do it..


  40. if u have administrator privilages, there is an another way, save as text file, then remove .txt extension, then over-write existing host file. u r done.

  41. To save the file you have to:

    1. Select Save As
    2. Change the filetypes setting to All Files
    3. Make sure your filename is hosts
    4. Click Save

  42. Many THANKS, Winsockfix!!! This was exactly what I needed. I love it when searching for solutions to problems is so easy and I find it first try.

  43. Thanks for the tip, its been a while since I had to edit my host file, anyway – Right to the point, thanks.

  44. ok, ive followed all the suggestions given so far, and i think its going ok but when i try to save it im told i cant coz its open or being used by another program? ive only got AVG running as far as i know, so why is that using it? if not why does it say this? cheers!

  45. Thanks!!!
    Simple and easy! :)

  46. If Windows 7 is ignoring your Hosts file, this is what worked for me: Solution to Ignored Windows 7 Hosts File. Good luck!

  47. I’m using win7 64bit.
    I have found the “hosts” but I can not edit it.
    I’m administrator, when I want to change the permission as an administrator, but I cant!!!
    IT’s owner is : system, and I cant modify the permission as an administrator neither…
    So what the f*** should I do?
    I hate win_DOS!

  48. @ssss – holy wow… did you not read the many, many entries above that tell you that when you start Notepad, you have to “Run as administrator”, even if you are already an administrator-class user?? Right-click the Notepad icon, you’ll see the option there.

  49. I’m using win7 pro 64bit running notepad pad as admin as well, but it won’t even open the host file, everytime I go o open it in notepad as the admin it opens the sample version only, I’ve also tried to load windows in safemode to no avail either trying to go to safe mode just takes me to startup repair, tatting to feet flustered, any other suggestions aside from whats already been listed

  50. when i open the hosts file, inside it says ‘This is a sample HOSTS file used by Microsoft TCP/IP for Windows.’ is it meant to say this? or am I doing something wrong? I opened the Hosts file in C:\Windows\System32\drivers\etc and in C:\Windows\winsxs\x86_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_045b589158ae90da help anyone?

 Leave a Reply



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>