[ADVANCED] Edit Windows `hosts` File to Preview Content

Need to preview your site on a new server before DNS propagates? Here is the best method (assuming you are running Microsoft Windows): 

In some versions of Windows XP or below, go to Start -> Programs -> Accessories and click "notepad" or in Windows 7, Vista, right click notepad and "Run As Administrator") 

In notepad, go to file -> open and put in filename: c:\windows\system32\drivers\etc\hosts 

Add the following lines to the BOTTOM of that file: 

############################# 
xxx.xxx.xxx.xxx yourdomain.com 
xxx.xxx.xxx.xxx www.yourdomain.com 
############################### 

(replace xxx.xxx.xxx.xxx with the IP address of the new server and "yourdomain.com" with the actual domain name you want to preview) 

Save the file - keep the window open 

In some versions of Windows XP or below, go to Start -> Programs -> Accessories and click "Command Prompt" or in Windows 7, Vista, right click Command Prompt and "Run As Administrator") 

Type: 

ipconfig /flushdns 

Once you are done with that try pinging any of the domains. They should respond from the new IP: 

================= 
ping www.yourdomain.com 

Reply from xxx.xxx.xxx.xxx 
================= 

If you see that, your computer has been fooled into seeing the domains on the new server, while the rest of the world sees the old server. You should then exit all open browers, clear cookies/cache, and then re-open your webbrowser and test the domains. Please report any problems to us. 

Once you are done testing, to return to normal, go back into the window with the "hosts" file and remove all of the lines with the IP addresses and hostnames that you added (but leave 127.0.0.1). Run the ipconfig /flushdns command again and re-ping the sites to make sure you see the old IP. That way, when you transfer DNS and change the A records on the old server, you can accurately tell when it has propagated. 
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

IP Justification Form

Tier.Net Technologies LLC IP Address Justification Form v1.1 • Overview The completion of...

Free WHMCS or ClientExec

Some of our packages include a free license for WHMCS or ClientExec. If you wish to take...

Free WHMCS or ClientExec

Some of our packages include a free license for WHMCS or ClientExec. If you wish to take...

How can I use SSH?

To protect the security of all of our users, SSH is not enabled by default for accounts. Please...

I did not receive my welcome email, but my service is listed as active

Sometimes, due to the high volume of mail we will send you in a short period of time some spam...

Powered by WHMCompleteSolution