test domain while it is resolving

if you are waiting for domain name details to propagate, but need to test the site that will use that domain now, there is an easy way around this. you can just hard code the new dns settings locally on your machine.

to do this in windows xp, open C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS and add a line of the form:

[ip address] [domain]
e.g. www.mydomain.com

you may need to refresh the dns records on your machine for this change to take effect. to do that, open up a command prompt and type:


hit return and you should see the following message:

Windows IP Configuration
Successfully flushed the DNS Resolver Cache.

from then on, when you visit the domain name you will be sent to the ip address you specified in the hosts file!

remember to remove the line you added once the domain resolves in case its details change again in the future. you can comment out the line if you prefer by prefixing it with a #.