Accessing your web site before DNS propagation is complete

DNS propagation must complete before starting to use your domain name. Visit this article to learn methods for viewing your site before it completes.

After you update your domain's name server settings, DNS propagation can take 24 hours to complete. During this time, you cannot use your domain name. However, you can bypass DNS and view your web site by using a shared URL or the hosts file.

Method #1: Use a shared URL

This is the recommended method, because you do not have to modify any configuration files on your local computer.

Hosting.com provides shared URLs that enable you to access your web site without using its domain name. The URL you use depends on the type of account you have, and which hosting.com server hosts your account. For information about how to view the correct shared URL for your account, please see this article.

🚧

Important

Some content management systems (CMS) and web applications may not display correctly when you use a shared URL. This is because they are configured to use your domain name, which is different from the shared URL. For example, you must update two database settings every time you use a different domain name with WordPress.

Method #2: Use the hosts file

Another method for bypassing DNS is to use the hosts file on your local computer. The hosts file contains domain name to IP address mappings. These mappings mimic the function of a DNS server, and allow you to "trick" your computer into associating a domain name with a particular IP address.

To use the hosts file to bypass DNS for your domain, follow these steps:

  1. Open the hosts file in a text editor. The location of the hosts file depends on your computer's operating system:

    • On Microsoft Windows computers, the hosts file is located at %SystemRoot%\system32\drivers\etc\hosts.

      📘

      Note

      • On Windows Vista, Windows 7, and Windows 8, click Start, search for Notepad, right-click the icon, and select Run as Administrator.

      • On Windows 10, click Start, type notepad, right-click Notepad, and then click Run as administrator.
        This starts Notepad with the elevated privileges necessary to open, modify, and save the hosts file. Note that in Notepad's Open dialog, you must use the All Files filter to see the hosts file.

    • On Apple Macintosh computers, the hosts file is located at /etc/hosts. For example, in a terminal window
      type sudo nano /etc/hosts to open the file in a text editor with the correct permissions.

    • On Linux computers, the hosts file is located at /etc/hosts.

    🚧

    Important

    The hosts file is a plain text file, so you should use a plain text editor like Notepad or nano to edit it. Do not use a word processor like Microsoft Word, which can add additional formatting and cause more problems than it solves!

  2. When you open the hosts file, you should see an entry that resembles the following line:

    127.0.0.1    localhost
    
  3. To create a new mapping for your domain, add the following line to the file:

    192.0.43.10    example.com www.example.com
    

Replace the IP address with your hosting.com server's IP address, and replace example.com with your web site's domain name. You can obtain your account's IP address by logging in to https://my.hosting.com.

  1. Save the hosts file and exit the text editor. For example, if you are using the nano text editor, press Ctrl+O, press Enter, and then press Ctrl+X.

    🚧

    Important

    If you are using Mac OS X, you should also clear the DNS cache. For information about how to do this, please see this article.

  2. To test the configuration, restart your web browser and go to http://example.com or http://www.example.com, whereexample.com represents your domain name. You should see your web site's main page (assuming you have created some content).

    🚧

    Important

    After DNS propagation is complete, make sure you go back and remove the relevant entries from the hosts file!

SSL certificates before propagation

Modern browsers increasingly expect SSL connections and generate error messages when SSL is not used. To get the best preview of your site before DNS updates, use one of the following methods. These methods only work with the hosts file method described above.

Copying an existing SSL certificate

If your site currently has an SSL certificate, you can move it to your new location. To move the SSL certificate, make a copy of the certificate and the private key. It is not necessary to move files; you can simply copy the certificate and key to your computer's clipboard and then paste it in place. For information about how to enter the certificate and key into your hosting control panel, please see this article.

Using a self-signed certificate

If you do not already have an SSL certificate, you can create one and use it temporarily to view your site with SSL. When your site is ready to go live, you should replace the self-signed certificate with a certificate from a recognized certificate authority (CA). For information about how to install a self-signed certificate, please see this article.

More Information

For more information about the hosts file, please visit http://en.wikipedia.org/wiki/Hosts_(file).

Related Articles