Access website without DNS setup

Hi, Im setting up CyberPanel and added a new wordpress website. I want to be able to access/edit the site here on CyberPanel before I update the main DNS for the domain which is currently pointing to a different server.

When I try and access https ://IP:8090/preview/the.site.tld/ it refirects to https ://the.site.tld:8090/ which isn’t valid as it’s looking at the original server, not the new one on the IP.

I’ve also tried https ://IP/~the.site.tld and https ://IP/~username but they just return a 404.

Appreciate any help.
Note I had to add a space after the https prefix as the form wasn’t allowing the link??? :frowning:

Thanks

This is a common issue when setting up a new site before updating DNS. The preview feature has limitations, but there are several workarounds. Here’s how to test your WordPress site locally before updating DNS:

Solution 1: Modify Your Local Hosts File (Recommended)

This temporarily redirects the domain to your CyberPanel server IP on your local machine only.

Windows:

  1. Open Notepad as Administrator
  2. Open file: C:\Windows\System32\drivers\etc\hosts
  3. Add this line at the bottom:
    YOUR_SERVER_IP the.site.tld
  4. Save the file
  5. Open Command Prompt as Administrator and run: ipconfig /flushdns

macOS:

  1. Open Terminal
  2. Run: sudo nano /etc/hosts
  3. Add this line at the bottom:
    YOUR_SERVER_IP the.site.tld
  4. Save (Ctrl+X, then Y, then Enter)
  5. Flush DNS: sudo dscacheutil -flushcache

Linux:

  1. Open terminal
  2. Run: sudo nano /etc/hosts
  3. Add this line at the bottom:
    YOUR_SERVER_IP the.site.tld
  4. Save (Ctrl+X, then Y, then Enter)
  5. Flush DNS: sudo systemctl restart systemd-resolved (Ubuntu/Debian) or sudo service network restart (CentOS/RHEL)

Solution 2: Create a Subdomain (Alternative)

  1. Create a subdomain like test.yourdomain.com in CyberPanel
  2. Point this subdomain’s DNS to your server IP
  3. Set up your WordPress site under this subdomain for testing
  4. Once satisfied, migrate to the main domain

Important Notes:

  • Solution 1 (hosts file) is the cleanest approach as it doesn’t require WordPress configuration changes
  • Always remove the hosts file entry after DNS is updated
  • The preview feature you mentioned has known limitations with redirects
  • Make sure your WordPress site is configured with the correct domain in CyberPanel before testing

After Testing:

  1. Remove the hosts file entry (Solution 1)
  2. Update your domain’s DNS to point to the CyberPanel server IP
  3. Wait for DNS propagation (usually 24-48 hours)
  4. Your site should then be accessible via the normal domain

This approach lets you fully test your WordPress site, including admin access, themes, and plugins, before making the DNS switch.

Thank you very much, I’ll give this a shot.