Previewing a website before domain propagation
May 28
So you’ve either just changed your nameservers to point to a new server or you want to work on a website before changing the nameservers to the new location and make it live. How do you view your site before on the other server before the rest of the world can? Like this:
Here is the location of your Hosts file on your PC (on a Mac it’s different, see below I’ll give some instructions for the Mac).
You can just copy & paste this in your windows explorer location bar, as show in the video or screenshots below:
C:\Windows\System32\drivers\etc
Don’t forget to choose “All files” from the drop down.
In the video above I show you 2 methods to do preview your website on the different server. Here they are again:
Method 1 – changing your hosts file
Step 1) In Vista & above – right-click on your Notepad program and select “run as administrator” (in preview Windows versions, this step is not needed).

Step 2) Once you have Notepad opened, choose file–>open from the menu and navigate to this location:
C:\Windows\System32\drivers\etc

Step 3) From the drop down that lets you choose which files to view, select “All files”

Step 4) Choose the file called “hosts”, select it and click “open”

When you open it, you should see a file that looks something like this:
Step 5) Don’t touch anything that’s already there but after the last entry, add 2 new lines.
On the first line, enter the IP address of the server to view your site on then to the right of the IP address, enter the domain name without http://www.
On the second line, enter the IP address again and to the right, enter the domain again but this time enter www. before the domain.
Step 6) Save the file (file–>save from the menu).
Step 7 ) Refresh your site, you should see your site on the other server. If you don’t it’s possible that your machine is still using a cached version, either way a while, try hard-refreshing the page (by holding the “ctrl” key and then while still holding it down, pressing “F5″ on your keyboard). If it still doesn’t work after a few minutes and a hard-refresh, you might need to clear your cache. One last trick to try is putting www. in front of your domain in your browser’s address bar if it’s not already there or removing it if it is.
Step 8 ) To revert this, simply remove the 2 entries from the hosts file and save the file again.
Note for Mac users: In OSX it’s a bit different but here is the command you would type in the terminal:
sudo echo "xxx.xxx.xxx.xxx www.yourdomain.com" >> /etc/hosts
Method 2 – Using PreviewaSite.com
I developed this website to simplify things and be able to more easily show clients their website before having it live without asking them to change their hosts file to preview it. The drawback is that it sometimes (rarely) wont’ display it exactly as you’d see it in your browser and also you can’t view any flash elements like movies or flash banner / ads. It’s definitely quicker and easier than changing your hosts file though
You just enter the domain, IP and agree to therm and click “Preview Site”
Click here to go to PreviewaSite.com





Related Reading:






