One of the most common questions we receive is “how do I preview my site before updating DNS?”. This is actually quite easy and just involves three simple steps:
Update you local hosts file
Most computers are configured to first look at a local “hosts” file before going to DNS. By simply adding one line to you local hosts file you can easily preview your site. On windows PC’s the hosts file will normally be located at c:\windows\system32\drivers\etc\hosts (the exact location can be different if you did not install windows in the standard “windows” directory). A default hosts file will look like:
# Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost
Simply add a line below the 127.0.0.1 line with your servers IP address and host name with your favorite text editor. The hosts file is simply a text file so make sure the file is saved as plain ASCII text. A sample would be:
127.0.0.1 localhost 123.123.123.123 www.mydomain.com mydomain.com
You will have to use your actual IP address and domain name.
Flush your current DNS cache
If you have been browsing your current site or grabbing email your PC will have the IP address for your web site cached. It’s very easy to flush your PC’s DNS cache:
- Open a dos prompt (select start, run, type cmd and press enter)
- Type “ipconfig /flushdns” (without the quotes)
- Close the Dos prompt by typing “exit” (without the quotes)
Restart your browser
Simply close any / all open browsers and then restart them. You should now be browsing your new web site.
Final thoughts
Remember that you are overriding DNS by putting an entry into the local hosts file. Once you are done testing remember to remove the entry from the hosts file, flush your DNS cache and restart your browser again or you won’t be able to access your real web site.
Categories
Tag Cloud
ATT Blog CloudFlare CloudLinux CMS cPanel dedicated Drupal email FTP Joomla lizzie Magento MySQL nds ntp Railgun Reseller Hosting security Shared Hosting Softaculous VPS W3 Total Cache WooCommerce WordPress WP Super CacheArchives
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- September 2011
- July 2011
- June 2011