How to update your host file on your PC

If you are making a new website it is really handy to be able to see and work on that website before it is live to the world but how do you do that? 

Well the first thing is to setup your hosting.  When you setup your hosting account you will get sent an email which tells you the IP address for your webhosting.  This part is important - note this down.

The next thing to do is to follow the below instructions to update the host file on your PC, essentially what this does is tells your computer to go to the new hosting when you type the url into a browser, but everyone else on the internet will go to the old website.

This allows you to work on your new website while the old one is live, this is very handy if it takes you a while to set everything up.

PC/Windows Host file update instructions

On a Windows 7 PC the host file is located  C:\Windows\System32\drivers\etc\hosts

Navigate to the etc folder and double click on hosts



Windows will ask you what program to open it with, choose Notepad.




Once it is open you will see the following.

Put the IP address of the new webhosting that you are working on and your domain name for that webhosting account.  It can be helpful to put the url with and without the www just to make sure.  Sometimes websites and CMS’s have links to both so it is good to make sure.



Technical Stuff you can read if you want

This is a short explanation how DNS works and what you have just done by updating the host file.

When you type in a domain name into a browser, your browser asks your nameserver (usually provided by your ISP) what the IP address is of the domain name that you just typed in.  Your browser then goes to that IP address to get the website.

This happens quite fast so you don’t really notice it.

When you update your host file for a particular domain name your PC does not ask the ISP’s nameserver what the IP address is for that particular website because it has already told your PC what the IP address that you want your PC to use for that URL.  So it will use that new IP that you specified, rather than asking your ISP’s nameservers.

Using this simple technique is really handy if you have a CMS like WordPress or Joomla or Drupal that you are working on as normally these sites are easiest to setup and configure on a live server.

That being said there is a really neat WordPress development platform called ServerPress which enables you to make your WordPress website on your local PC, then you can upload it to your hosting once you have made it.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to setup email accounts with CyberHub's webhosting

The first thing is to login to your CyberHub webhosting account using your username and password....

How to setup Outlook with CyberHub's webhosting email

If you are familar with how to setup Outlook with POP email use the settings below otherwise...

How to setup iPhone with CyberHub's webhosting email

If you are familar with how to setup your iPhone with POP email then use the settings below...

How to setup free webhosting with CyberHub

It is very easy to setup free webhosting with CyberHub.Go to CyberHub's Linux Webhosting Page...

How to update your host file on your Mac OS

If you are making a new website it is really handy to be able to see and work on that website...