How can I view my development site before my domain is pointing to it? Print

  • Windows10, website design
  • 0

Hosts File Hack

So you have ordered hosting and want to work on your new website however your domain name is still pointing to your old website which is with another web hosting provider.

Your new website is not finished yet so you don't want visitors to view it yet - but you need to see it while you are working on it!

You can solve this problem using what is typically referred to as a "hosts file hack".

Every operating system has a hosts file and one can use it to bypass the IP address that a live domain name is broadcasting.

By editing your hosts file you can trick your browser into thinking that a website is located at a different IP address (or web host).

Hosts File Hack For Windows10

Editing a host file is done a little differently depending on which operating system you are using. Here is how it is done in Windows 10.

  1. Click the Windows start icon and in the search box type in "NotePad". (On some computers right mouse click the start button to find the Search option)
  2. Don't click the NotePad icon though! Instead click "Run as administrator" or right mouse click the icon and choose "Run as administrator"
  3. Click "Yes" at the prompt
  4. The file you want to open is located here: C:\WINDOWS\system32\drivers\etc\hosts
  5. To find it click "File" - "Open"
  6. In the bottom right hand corner choose "All Files" (instead of TXT files)
  7. Then browse to the file and click it: drivers - etc - hosts
  8. Then click "Open"

Now that you have the hosts file open add a line that looks like this:

202.130.34.75 YOUR-DOMAIN-NAME-HERE.com.au www.YOUR-DOMAIN-NAME-HERE.com.au

and hit save!

if I was doing this for the computerjazz.net website I would enter:

202.130.34.75 computerjazz.net www.computerjazz.net

All you need to do now is close and then re-start your browser.

You should now be able to see your development website.

When you are done editing and want to see your live website repeat the process and disable the hack.

You can disable it by putting a hash in front of the line i.e.

#202.130.34.75 computerjazz.net www.computerjazz.net

Then save again, re-start your browser and your live website will load again.

Hosts File Hack For Other Operating Systems

You can do the same thing on Apple, Linux and Android devices.

Just search the internet and you will find HowTo guides for every operating system.


Was this answer helpful?

« Back
Local Call Cost: 1300 79 4441
Landline: +61 3 9310 2291