How to access your website at your new web host before DNS propagates

March 30th, 2007

Often when switching hosts or signing up at new host you’ll have to set your domain’s name servers to your new website host’s name servers. This step is necessary because it allows your new host’s servers to receive and serve requests for your website from your visitor’s browsers. However the Domain Name System (DNS) is such that it takes time for this new mapping between your domain name and your host’s servers to propagate across the Internet.

Depending on your new host’s DNS servers and your Internet Service Provider it can take anywhere from a few hours to a few days before you will be able to access your website via the domain name. If, in the meantime, you want to upload files to your website and test it you will need to edit your HOSTS file to manually map your domain name to your web host’s IP address.

The first step is finding out the IP address of your new host’s servers. A lot of enlightened hosts include this information in the email they send you when you sign up with them. In that case you can skip to the next step. But if your host does not provide with this info then you will have to do an ns lookup:

  • Go to http://www.kloth.net/services/nslookup.php
  • Type in your domain name, your web host’s DNS name server and make sure that the query field says A ipv4 address.
  • Click on lookup and you should see your site’s new ip address.

Next open up your HOSTS file using your favourite text editor such as notepad. On Windows you can open this file by copy pasting %systemroot%\system32\drivers\etc\HOSTS into your editor’s open file window. In most cases you can also try C:\WINDOWS\system32\drivers\etc\HOSTS . Keep in mind that the file has no extension.

On Linux you will usually find this file at /etc/hosts.

Open up the file and on a new line type in your host’s ip address followed by a space and your domain name. For ex:

208.113.192.208  websitetheme.com

You may also prefer to add the www version:

208.113.192.208 websitetheme.com www.websitetheme.com

Save the file and try to access your site by typing in your domain name in your favourite browser. It should work now! To enable ftp access add  the ftp subdomain:

208.113.192.208 ftp.websitetheme.com

Using this technique you should be able to access your site while DNS is being propagated.

Troubleshooting

If you still have problems the cause is likely operating system or browser level caching of the old IP address. To address that ( :) ) you can take the following steps:

  • On Windows XP go to start -> run type in cmd.exe and press enter. On Windows 7 just go to start and type in cmd to get the command prompt option.
  • Type the command “ipconfig /flushdns” in the command prompt window and press enter.

The above steps clear your OS level DNS cache. Try accessing your site now. If it still doesn’t work you will have to clear your browser DNS cache. On Firefox this can be done simply by installing and using the DNS flusher extension. On other browsers you will have to consult the browser documentation or search online.

Related posts:

7 Responses to “How to access your website at your new web host before DNS propagates”

  1. John Roberts says:

    Or you can use OpenDNS, and use CacheCheck to get your domain updated instantly for OpenDNS customers. http://cache.opendns.com/

    Just saying. ;-)

    John Roberts
    OpenDNS

    Posted on 01 Apr 2007 Reply
    • Abdussamad Abdurrazzaq says:

      Yeah you’re right :) . I read about this on namepros and I thought hey isn’t that just so much simpler :p . But I guess it doesn’t hurt to have other options. Especially for people who *have* to use their ISPs DNS servers or perhaps are behind a firewall.

      Posted on 01 Apr 2007 Reply
  2. Hamad says:

    Thank you. I appreciate your help.

    Posted on 17 Dec 2009 Reply
  3. Hossam says:

    Thanks this really helps :)

    Posted on 16 Jul 2011 Reply
  4. Hosting Blog Coupon says:

    the ip address usually included when we purchase the hosting

    Posted on 03 Aug 2011 Reply
  5. Rochelle says:

    still doesn’t work for me :(

    Posted on 08 Feb 2012 Reply
    • Abdussamad says:

      I have the updated the article with some new tips. Please try them out!

      Posted on 09 Feb 2012 Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">