Accessing your website before DNS propagates

Many people want to access their newly hosted website at dreamhost either before changing the DNS records to point at dreamhost, or before the DNS records have been fully propagated through the net. The end result is that they want to access their domain “” before “” points at the correct IP address.

Well, you can do this sometimes by editing the hosts file on your system. Steps for windows if your domain was called “”.

  1. get the IP address of your domain at dreamhost.

Default Server:


Default Server:






The returned IP address for your domain “” at dreamhost is “”.

Note that the nameservers at dreamhost seem to be pretty flaky and often return errors. If ns2 doesn’t work, try again and again or change the lserver to ns1 or ns3.

  1. open the hosts file to edit it. On Windows XP this is found by default at: c:\windows\system32\drivers\etc\hosts

Open it in notepad and then add the following lines to the end of the file…

e.g. for the previous domain example it would be:

Save and close the file. You should then be able to access the new site hosted at dreamhost using the domain name “”.

Note that this will prevent you from accessing the current “” at the current host. You will need to comment out or delete those lines from the hosts file to see it again.

Note that you should also delete those lines once it is available via the normal DNS system, otherwise Murphy’s Law ensures that something will happen which will make you wish that you did.

Also note that if your site never actually references it’s own domain name (i.e. there are no links to, just to relative paths like / or /pr0n) then you may be able to add the entries in the hosts with a madeup name and access both sites simultaneously. e.g.

I’m not making any guarantees that this will actually work for you, although it does for me.


It’s a great tips.

I used it when i wanted to make/test a website in real conditions (path, sql access…) without changing dns.

Then, when everything was ready, i just changed dns, and everyone saw the new website.

DNS propagation take in practice usually less than 1 hour.

Get [color=#CC0000]$97[/color] Off with promo code [color=#6600CC]97DREAM[/color] :cool:

That seems awfully complicated. Much easier to create a subdomain of that mirrors That way you can include absolute links when you need to that point to

And those links don’t work when you stop using whereas with the hosts file it works for both server side domain lookup (as dreamhost servers use their own DNS for your domain) and with client-side lookup because you have overridden the domain. It’s all good.