Questions? Feedback? powered by Olark live chat software
Knowledgebase Articles: How-To Guides
Author Avatar

How To Edit Hosts File

Written by: on 20 July 2012 03:51 PM 20 July 2012 03:51 PM

On occasion you will need to edit the hosts file on your machine. VPSBlocks provides details on how to edit hosts file.

If you want to make your local computer believe that your website is hosted on your new VPS before you modify the actual DNS, this can easily be done by modifying your hosts file.

  • Click the 'Start' button in Windows on your LOCAL computer
  • Type in: notepad
  • Right click on the link to notepad that appears, and choose 'Run as Administrator'
  • When notepad opens go to File -> Open
  • Browse to c:\windows\system32\drivers\etc
  • Open the file 'hosts' in notepad
  • Add a lines to the bottom:

x.x.x.x www.yourdomain.com
x.x.x.x yourdomain.com

  • Where x.x.x.x is your VPSBlocks VPS IP address and yourdomain.com is the domain you use to access your website.
  • Save the file.
  • Close all instances of your browser.
  • Reopen your browser and browse to www.yourdomain.com and what you see will be served from your new VPS.

Once you have completed any testing always modify your hosts file again and remove the lines you added.

(1 vote(s))
Helpful
Not helpful