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  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    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 : Oracle Gold Partner specialising in Design, Implement, and Trainings.

follow me on:

Leave a Comment:

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.

Vista suck says August 26, 2008

I did whatever u told me but nothing happened.
Here is what my host file contrains. localhost
# Lineage][Storm Connection

Atul says August 26, 2008

Nothing happened means ?

Can’t you see entry in hosts files ?


you can’t save hosts file

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.

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

Vista suck says August 27, 2008

Ok i did it ty for help

Vista suck says August 27, 2008

ty = thank you !!!

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.&&.$$.$$ .com suppose the ip add is of google then when ever i type google should come up but that does’nt happens , it just blocks

kunal198916 says September 29, 2008

its related to hosts file

suruku says December 15, 2008

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

guenter says January 24, 2009

can’t find the hosts file in w2k8

any idea?

Ozan K. BAYRAM says August 6, 2009

You have to change attributes to edit file.

dietke says October 30, 2009

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

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…..

Atul Kumar says July 19, 2010

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

Pablo says November 10, 2010

Thanks!!! U rock, dude.

Josh says February 10, 2012

I switch different Hosts-Files with this tool here:

Add Your Reply