Testing a Website Before DNS Propogates

Posted by jason on June 10, 2011, 9:45 p.m.
Tags: dns linux web

When I want to migrate a website to a new server--or even launch a new site--I like to do it well in advance and make sure everything is behaving as expected.

As an example, if I migrate jasonmaur.com to a new server that has shared hosting with Apache VirtualHosts set up (so I can't just enter the IP address into the browser to see my site), I want a way to test it before pulling the trigger and updating the DNS record for that domain name.

Thankfully, it's easy to do. Let's say the new IP address is 72.1.1.1. In Linux, just add a line to /etc/hosts:

72.1.1.1    jasonmaur.com www.jasonmaur.com

In Windows XP, you would add the same line to the C:\WINDOWS\system32\drivers\etc\hosts file. I'm not sure about Windows 7, but it's probably something similar.

Now when I open my browser and go to either "jasonmaur.com" or "www.jasonmaur.com", I'll be accessing my site on the new server and be able to deal with any issues before blindly updating the domain's DNS record.


0 comments