Articles in this section

How to open a website that exists in Plesk, but is not yet resolving to the Plesk server?

Plesk for Windows kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Question

  • How to access a website or webmail that exists in Plesk, but is not yet resolving to the Plesk server? For example, when a website was created for tests, recently migrated or its DNS zone has not propagated through the internet yet.
  • How to preview a website migrated to a Plesk server before switching its DNS records? 

Answer

Accessing a website using Plesk Preview feature

 

  1. Log into Plesk

  2. Go to Websites & Domains > example.com.

  3. Click Preview under the domain.

    Note: Preview feature requires nginx reverse proxy. Otherwise, the Preview button will be unavailable.


    Screenshot_2022-03-30_at_12-40-07_example.com_-_Plesk_Obsidian_18.0.42.png

Accessing a website / webmail using a local hosts file


Modifying the 'hosts' file allows overriding DNS for a domain on a particular machine and causes local machine to look directly at the IP address specified.

For example, the domain example.com is hosted on a server with IP address 203.0.113.2, but is not resolved to this IP from the Internet. To make your PC/Mac resolve this website to this particular IP address, add the line below to your local 'hosts' file:

CONFIG_TEXT: 203.0.113.2 example.com www.example.com

Modifying the 'hosts' file...

  • on Windows OS

    1. Start a command prompt as an Administrator.

    2. Run the following command to open the 'hosts' file in Windows Notepad:

      C:\> notepad C:\Windows\System32\Drivers\etc\hosts

    3. Add domain's IP address and a domain name on a new line.

    4. Click File > Save to save your changes.

       

  • on macOS

    1. Open Applications > Utilities > Terminal.

    2. Open the hosts file by typing the following line in a terminal window:

      # sudo nano /private/etc/hosts

      Type your domain user password when prompted.

    3. Add domain's IP address and a domain name on a new line.

      Note: The file contains some comments (lines starting with a hash "#" symbol) and some default hostname mappings (for example, 127.0.0.1 – local host). Add your new mappings after the default mappings.

    4. Save the hosts file by pressing 'Control+x' and answering y.

    5. Make changes take effect by flushing the DNS cache with the following command:

      # dscacheutil -flushcache

       

  • on Linux OS

    1. In Linux terminal, open the 'hosts' file in a text editor:

      # vi /etc/hosts

    2. Add domain's IP address and a domain name on a new line.

    3. Save the changes and close the file.

Accessing a website using a public server IP address

 

  1. Log into Plesk

  2. Go to Tools & Settings > IP Addresses > click on a public IP address, to which the required domain is assigned in Plesk > select an offline website as a Default site from the drop-down menu.

  3. Now, to access the domain, type in the public IP address chosen above in a web-browser: http://203.0.112.2:80.

    Note: example.com should be assigned to this IP address in Plesk at Domains > example.com > Hosting Settings. Otherwise, it will not appear in the list.


    Screenshot_2022-03-30_at_12-51-18_IP_address_203.0.113.2_on_the_interface_ens3_-_Plesk_Obsidian_18.0.39.png

Was this article helpful?

Comments

3 comments
Date Votes
  • I did what was suggested for "Accessing a website using a public server IP address" but by visiting the example.ext site I am redirected to the server IP. I think there is a step missing from the procedure indicated.

    0
  • NGINX is installed but the preview button is still missing (v. 18.0.65)

    0
  • NGINX is installed but the preview button is still missing (v. 18.0.65)

    0

Please sign in to leave a comment.