How can I preview my website before switching DNS?

There are a few different ways to preview your website before switching the nameservers or changing DNS settings.

This method is also very useful if you want to access your website without waiting for DNS propagation which can take several hours.

Before we can start, you need to know the IP address of the server, where your website is located.

If you are using our cloud hosting package, the IP address can be found in the cloud panel on the overview page of the application (in the main menu click Applications and click the desired domain name). The IP address of our cPanel packages can be found directly in the cPanel control panel in the right sidebar (named Shared IP Address).

Now that you have found the IP address of your website we can start.

Changing the system hosts file

This method will only work for the local system. If someone else would like to test the website, they will need to follow the same steps for modifying the system hosts file.

Windows

This step-by-step guide will show you how to adjust your system hosts file in Windows.

  1. Locate the Notepad program using the method corresponding to your version of Windows:
    1. For Windows 7 and earlier, click Start, Accessories.
      For Windows 8 or 10, type Notepad into the Start menu.
    2. When the Notepad option appears, right-click on it and select Run as administrator.
  2. In Notepad, click FileOpen and browse to C:\Windows\System32\drivers\etc.
  3. In order to see the hosts file, change the file type from *.txt to *.* in the lower right drop-down menu.
  4. Double-click the hosts file to open it
  5. Using the previously found IP address, add the following lines to the file at the bottom of the hosts file:
    12.34.56.78 domain.com
    12.34.56.78 www.domain.com
    Replace 12.34.56.78 with the IP address previously found and domain.com with your domain name.
  6. Go to File and click Save to save the changes.

Now restart the browser and try accessing your website.

Linux and Mac OS

For Linux and Mac OS users, the hosts file is located at /etc/hosts. You have to make changes to the hosts file as a superuser/administrator.

Simply add the following entries to the bottom of the file:

12.34.56.78 domain.com
12.34.56.78 www.domain.com

Replace 12.34.56.78 with the IP address previously found and domain.com with your domain name.

Now restart the browser and try accessing your website.

Reverting the changes

To revert the changes, simply remove the previously added files.

Leave a Comment

Your email address will not be published. Required fields are marked *