Change “hosts” file in Windows Vista

If you wish to connect to a machine by hostname (which is not registered in DNS (Domain Name Server)) you need to add <IP> <Fully Qualified Hostname> <Hostname> in Hosts file.
   Adding an entry in Non Vista (Microsoft O.S. XP, 2000, NT) is pretty simple. Open hosts file (using text editor like notepad, wordpad..) and hostname entry in above format like

192.168.0.1  myMachine.myDomain  myMachine

  • Location of hosts file in windows is C:\Windows\System32\drivers\etc  (where C is drive in which you installed operating system)
  • Location of hosts file in Unix/Linux is /etc

Change hosts file in Windows Vista

If your O.S. is windows vista, it won’t let you save your hosts file if you don’t open file editor (like notepad) with Administrator Privileges

  • Click Start -> All Programs -> Accessories
  • Right click Notepad and select “Run as Administrator
  • On Notepad click on File -> Open
  • Browse to “C:\Windows\System32\Drivers\etc
  • Change the file filter drop down box from “Text Documents (*.txt)” to “All Files (*.*)
  • Select file hosts and click on Open
  • Add entry of host which you wish to connect in format
    <IP Address> <Machine Name> <Machine Alias>  like
    192.168.1.1    myMachine.myDomainName  myMachine

Note : If you can’t find Accessories under All Programs then to identify Program (Notepad) type notepad in Start Search box after clicking on Start menu at bottom left of your laptop

* Ensure you don’t savefile as type text (hosts.txt),  file name should be just hosts

About the Author Atul Kumar

Oracle ACE, Author, Speaker and Founder of K21 Technologies & K21 Academy : Specialising in Design, Implement, and Trainings.

follow me on:

Leave a Comment:

17 comments
famy says May 11, 2008

By default in vista , UAC ( User Account Control ) is enabled.

To disable, go to Control Panel, Click
on “classic view”, click on “user accounts”,
click on “turn user account control on or off”

Then disable the option by unchecking it.
Restart once.

Now to Start > Run ( windows key + R )
type “drivers”

click on etc > hosts

Now you can edit and save with all privileges.

Reply
Vista suck says August 26, 2008

I did whatever u told me but nothing happened.
Here is what my host file contrains.

127.0.0.1 localhost
#——————————————
# Lineage][Storm Connection
#——————————————
77.234.135.65 L2authd.lineage2.com
77.234.135.65 L2testauthd.lineage2.com
216.107.250.194 nProtect.lineage2.com
#——————————————

Reply
Atul says August 26, 2008

Nothing happened means ?

Can’t you see entry in hosts files ?

Or

you can’t save hosts file

Reply
Vista suck says August 27, 2008

When i go to save the changes a window pop ups and says:The creation of this file cant be done(it doesnt say that but i translate it because my pc is in greek)and a little bit more down it says:Be sure that the destination in C and the name of the file are correct.

I dont know what happenned about few days later i could change the hosts but yestarday i couldnt.

Reply
Atul says August 27, 2008

Did you open notepad (any tool you are using to edit file) as administrator ?

Right click on file and under properties check if this file (hosts) is not write protected .

Also as suggested by Famy, in comment section disable user access control and reboot vista machine

Reply
Vista suck says August 27, 2008

Ok i did it ty for help

Reply
Vista suck says August 27, 2008

ty = thank you !!!

Reply
kunal198916 says September 29, 2008

i want to open any other website by adding the ip add and the domain name or the website name but instead of opening it , it blocks the website i.e the name of the website eg:- 209.&&.$$.$$ http://www.download .com suppose the ip add is of google then when ever i type download.com google should come up but that does’nt happens , it just blocks download.com

Reply
kunal198916 says September 29, 2008

its related to hosts file

Reply
suruku says December 15, 2008

Thank you for the information. I could edit
host file sucessfully

Reply
guenter says January 24, 2009

can’t find the hosts file in w2k8

any idea?

Reply
Ozan K. BAYRAM says August 6, 2009

You have to change attributes to edit file.
Solution:
http://www.emeksepeti.com/blog/post/2009/08/06/Changing-your-hosts-file-in-Vista.aspx

Reply
dietke says October 30, 2009

Thank you so much for posting this! It was a GREAT help!!

Reply
dhananjay s says July 18, 2010

hi sir i am Dhananjay i hv a core i3 330 processor. laptop can i install oracle apps r12 e-business suite. ok thank you reply plz…..

Reply
Atul Kumar says July 19, 2010

@ dhananjay, Yes you can. Ensure that you have atleast 4 GB memory

Reply
Pablo says November 10, 2010

Thanks!!! U rock, dude.

Reply
Josh says February 10, 2012

I switch different Hosts-Files with this tool here:

http://tools.toflo.de/HostsSwitcher/

Reply
Add Your Reply

Not found