How To View Your Website On It’s New Host Before Nameservers Finish Propagating

One of the most annoying and time consuming factors in switching hosts is waiting the Internet to catch up with the changes you’ve made.  Typically, once you switch your nameservers you have to wait anywhere from 8 to 24 hours (and in some cases more) for the information to flow through Google and all the other spiders so your website can be viewed as it is in real time. Sometimes, even when you can have instant results like with CloudFlare, you want to make sure everything looks right on your new host before you allow it to go live to the public.  You can do this by forcing your local computer to resolve the DNS of your domain for a specific IP address by editing the local ‘hosts’ file.

BeforeNameservers

These instructions are for Windows 10, but will work for most previous versions.  

  1. Go to Windows Accessories in the Start Menu -> All Apps and find NotePad.  Right click on the NotePad icon and click on the menu option “More” then click on “Run As Administrator”.  It will ask if you really want to do this, just click yes.
  2. In the NotePad window click File->Open and navigate to c:/Windows/System32/drivers/etc and find the ‘hosts’ file.  If you don’t see anything in the window make sure that the search box is set to ‘All Files’ not just .txt.
  3. Once open find the section which looks like this – and enter the followingIP_address domainname.com
    IP_address http://www.domainname.com

    where IP_address is the IP address of your account on the server and domainname.com is your actual domain name (do this for all subdomains, too):under the section of the file that says –
    # localhost name resolution is handled within DNS itself.
    # 127.0.0.1       localhost
    # ::1             localhost

    By the way DO NOT add the # sign at the beginning of the lines you type in.
    This is where I found the information that helped me resolve this problem –
    https://www.namecheap.com/support/knowle…ns-records

    https://support.microsoft.com/en-us/kb/923947

  4. Now save and close the ‘hosts’ file
  5. Go to Start Menu -> All Apps -> Windows System – > open the Command Prompt.  When the cmd prompt window opens type in ipconfig /flushDNS.  This will clear the DNS cache allowing your browsers to resolve the new information you’ve input in your ‘hosts’ file.
  6. Open your browser and type in your domain name.  This should take you to the version on the new host server.
  7. Alternatively you can use the service https://hosts.cx/ . You will need to add your server’s IP address ‘XXX.XXX.XXX.X’ to the ‘Server Address’ field and whateveryourdomainis.com to the ‘Website Name’ field. It will give you a special URL with which to view the new site.  The only problem is it will not properly show your media files.

Have any questions?  Please feel free to leave them in the comments below.  I love doing research so if I don’t know I’ll find out for you :).

Are you looking to switch web hosts but not sure which to choose?  Check out NameCheap.  I just recently switched. Not only are they one of the least expensive options out there, but their service is bar none the best I’ve experienced in all my years of hosting websites and blogs.  

This post contains affiliate links.  Clicking on these links may result in compensation for this blog.

Leave a Reply

Your email address will not be published.