How can I test or preview my website before switching DNS? Print

  • 50

If you have recently registered a new domain or updated the DNS of your existing domain name at your current registrar, it can take anywhere from 24 to 72 hours for the domain name servers to fully propagate across the web. Rather than wait for the propagation process, you can test or preview your website on our servers before DNS propagation using various different methods.

Testing your website using your Temporary URL

cPanel servers usually allow checking your website using a temporary URL (http://12.34.55.33/~username/) however due to mod_userdir module being insecure, it can leave your website vulnerable to malicious attacks. Because of this, mod_userdir and temporary URLs are disabled on our shared & reseller hosting servers.

Modifying computer's HOSTS file

The best method of testing or previewing your website is by modifying your computer's local HOSTS file. The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file, and is conventionally named hosts. 

WINDOWS OS

  1. Locate Notepad from your Start menu search.
    • For Windows 7 and earlier, click Start >Accessories. For Windows 8 and 10, type Notepad from the Start screen.

      NOTE: You will have to use Notepad with administrative privileges in order to be able to modify the HOSTS file (right click Notepad -> Run as Administrator).
  2. Open your HOSTS file. Typically it is in one of the following location: C:\windows\system32\drivers\etc\hosts

  3. In the HOSTS File you will see two columns, one containing the IP address and the second containing host name. You can add additional lines to the HOSTS file which will point your requests for that particular domain to your new server IP.

    Example:

    12.34.56.789 domain1.com
    #11.22.33.444 www.domain1.com

  4. Take note of your server's IP address from cPanel or your welcome email. If you do not have the IP address or cannot find it, contact our support. Scroll to the end of the file and then type the following information all on the same line:

    123.44.56.786 domain.com www.domain.com

    (
    Replace "123.44.56.786" with your server IP and domain.com with your actual domain name)
  5. Save changes! Restart any open browsers and navigate to your domain.com it should now load from our servers! To revert the changes, simply remove the lines you added and save changes again!

MAC OS X

  1. Open Terminal  by going into Applications > Utilities > Terminal
  2. open the HOSTS file by typing the following in the Terminal  app
    sudo nano /private/etc/hosts 
  3.  Input your USER password at the prompt
  4. Your Hosts file will look something like this

    Filename: hosts

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost

  5. Add your domain and IP address to the bottom of the file.

    123.23.44.55 example.com
    123.23.44.55 www.example.com

  6. Save the hosts file (press CTRL+O to save the HOSTS file > press Enter on the filename prompt > Ctrl+X to exit editor).
NOTE: To revert changes, simply remove the new entries added to your host file or simply comment them out by adding ‘#’ at the beginning of each line and save changes. You may also need to clear your browser cache.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution