If you’ve recently registered a new domain or changed, you may be in limbo until your DNS settings propagate across the internet. If you want to view your site as it exists on a new server before the DNS change has completed, you have to tell your computer where to find your site. The easiest way to do this is to use the “hosts” file on your computer. You will need to know the IP address of your new server that will host your website – contact your new host if you don’t know it.
WINDOWS
Use ONLY Notepad to edit your hosts file! DO NOT use Word, Wordpad, Works or another word processing program to edit this file!
If you use Windows Vista or Windows 7, you must right-click the Notepad icon and choose to “run as administrator.”
Your hosts file can be found at:
Windows 95/98/ME – C:\windows\hosts
Windows NT/2000/XP Professional – C:\winnt\system32\drivers\etc\hosts
Windows XP Home or Corporate, Vista, or 7 – C:\windows\system32\drivers\etc\hosts
Once you have the file open in Notepad, add two new lines that look like this:
123.456.78.9 yoursite.com
123.456.78.9 www.yoursite.com
Use your new IP address (that you got from your host) and your domain name. You may need to reboot your computer to register the changes. Once that’s done you can open yoursite.com in a web browser and you will be looking at your site on your new server. To undo this change, remove those lines from your hosts file and reboot your computer.
LINUX OR MAC OSX
On a Linux or Macintosh machine, the hosts file is /etc/hosts. You will need root access to change this file. Your hosts entry should look like this:
yoursite.com 123.456.78.9
Use your new IP and your domain name. You do not need to reboot your computer, but you may need to restart your web browser.