GammaFX, Inc.
Advanced creative solutions for your brand

Changing your hosts file on Windows Vista and others

September 27th, 2008 by gammafx (0) Blog

During development and testing phases of the web development projects, one might need to direct a certain domain to a new IP address without making a global DNS change.

Enter the HOSTS file!

Simply add the following line to that file (using your own IP and DOMAIN)

192.168.0.1 www.yourdomain.com 

and voila… the domain now points to the new server.  Obviously this only affects your local machine.

Here are the locations of the HOSTS file on various operating systems:

  • Windows 95/98/Me c:\windows\hosts
  • Windows NT/2000/XP Pro  c:\winnt\system32\drivers\etc\hosts
  • Windows XP Home c:\windows\system32\drivers\etc\hosts

On Vista, it gets a bit tricky…

By default, if you try to modify your hosts file in Vista, it will not let you save it.  It tells you that you don’t have permission.  To successfully modify the hosts file, run notepad.exe as an administrator and open the file.

  1. Browse to Start -> All Programs -> Accessories
  2. Right click “Notepad” and select “Run as administrator”
  3. Click “Continue” on the UAC prompt
  4. Click File -> Open
  5. Browse to “C:\Windows\System32\Drivers\etc”
  6. Change the file filter drop down box from “Text Documents (*.txt)” to “All Files (*.*)”
  7. Select “hosts” and click “Open”
  8. Make the needed changes and close Notepad.  Save when prompted.

Leave a Comment


seven + 3 =