Wednesday, March 5, 2008

Previewing a Site Before DNS Propogation

If you need to view a website before DNS has propogated to your server, you can modify your computer’s hosts file to accomplish this. This trick is especially useful when you are migrating a site to a new server and wish to test it there before switching the DNS entries over.

On a Windows machine, open C:\WINDOWS\system32\drivers\etc\hosts using notepad. If you are running Linux or Mac OS X, you will need to open /etc/hosts instead.

Once you have the file opened, you will need to add entries for your site:

X.X.X.X domain.com
X.X.X.X www.domain.com

Replace X.X.X.X with the IP address that the site is running on. Save this file and then access the site with your web browser as you would normally. You may need to quit your web browser and open a new one in order for this to take effect.

No comments: