Edit hosts file in Windows 7 & Windows Vista
If you're new here, you may want to subscribe to Windows Reference RSS feed Thanks for visiting!
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!!!
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically each day to your feed reader.
Trackbacks & Pingbacks
Comments
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>






This help saved some of my time.
When I have logged in to Windows as Administrator, then why there should be a separate process like ‘Run as Administrator’? Is it a bug, or something to do with the security?
Your tip was the ONLY one that even came close to working!
Thanks
You’ve bypassed my reason for refusing to use Windows 7! Usually, I drill down to the file and click on it to open / edit.
When it refuses to save, I get caught up in trying to edit folder permissions. Eventually, I say “stuff this for a joke” and revert to XP.
Of course, I still think it’s a pretty STUPID setup. I have Admin rights- I should be able to do anything I want!
I have no etc folder in C:\windows\system32\drivers\ WHY
Just wanted to say ‘Thanks’ for this.
I now know how to edit the HOSTS file in Windows 7! WOOT!
I just used this to change my hosts file, under Windows 7 – but it seems that W7 is not using the hosts file.
Why? How to fix??
It worked! Thanks for this, it really helped me a lot!
Didn’t work for me! – In Win7, running Notepad as admin it still opens the hosts file as a sample, and will only allow me to edit the sample not the real hosts file…
I have some very old applications that wont work if I cant edit this – Really need the help here!
Hopefully someone found a working solution!
Thx!
Peter: Give it another go. I’ve just verified that this definitely works with Win 7 RTM. Open Notepad > File-Open… > Drill down to the Hosts file > edit it > save it > done.
Windows 7 use is an other hosts file
C:\Windows\winsxs\amd64_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7100.0_none_d196965304ce3de
I got there by copying this %systemroot%\system32\drivers\etc\
into the file name entry, takes you right to it.
thanks, it’s useful
It works for me,when I opened Notepad as “Administrator” and then open the host file from C:\Windows\System32\drivers\etc\hosts. After you make the changes then save it,it should works well.
Good Luck
Thanks a lot. This saved my life.!!!!!!!!!!!
Thanks dude. Love your work.
yeah so after fiddeling with this in windows 7 and having sum issues with actually saving the file as a host and not a .txt file. i finally figured it out.
The notepad must be run as administrator and you must go to the properties of the host file and uncheck read only. once read only is unchecked you can modify and save the host file.
When you save it scroll down and save as “all types” or your hosts file will be saved as txt. file. it will tell you that file already exists and ” do you want to replace hosts with this file” Click ok.
It is a wise choice to actually save a backup copy of your original hosts file just in case you mess up some how. ya never know?
Now everything works fine. I blocked a ton of bad sites i was having problems with. Thanks for the tut and info. Much appreciated . =]
Thanks a lot man. this really helped me
.People like you are the one who encourage me in Internet world .
Helped me plenty! Thanks!
Hi – I’m runnign windows 7 and have follwed all the instructions. Even when using ultraedit to open the hosts file, the modifications are there and it is saved properly. I flush the dns and restart even and the entries aren’t resolving.
grrrr.
Thank you for the information. I would never have figured out how to give the notepad administrative power on my own.
Hi, thx for the hint… it surely saved me much time frickeling around, shouting at ms and my pc ;o)
Thx a lot!
THANKS A LOT! Sad that actually we “have” admin rights and can´t do everything we like. But who cares, now I have it done! thanks again