Learn how to do CyberPanel change hostname properly with SSL, Postfix, and Dovecot configuration. Follow exact commands and avoid errors. Our CyberPanel Support Team is always here to help you.
Complete CyberPanel Change Hostname Walkthrough with DNS and SSL
Managing servers often means making hostname adjustments. For anyone using CyberPanel, the process requires a few precise changes, from panel setup to mail service configuration. Below you’ll find everything laid out in one place, with each command you need to execute. This guide focuses on CyberPanel change hostname in a straightforward way without skipping the essentials.
An Overview
Setting up Hostname on CyberPanel with SSL
First, ensure your root domain is already configured in QuicCloud DNS Zone. After that, log in to CyberPanel.
- First create a Website – this site will act as your hostname website.
- Head to SSL > Hostname SSL, pick the website you just created from the dropdown, and click Issue SSL.
Now open SSH and log in as root:
sudo su -
nano /usr/local/lsws/conf/httpd_config.xml
Then Find the <address> section and insert the following (replace with your hostname and port):
panel.my-domain.com:2083
proxy cyberpanel panel.my-domain.com:2083 100 60 60 0 0
After that Restart LiteSpeed after saving changes:
/usr/local/lsws/bin/lswsctrl restart
Next, go to CyberPanel → Hostname Website → File Manager → create .htaccess under public_html (if not present) and add this:
BEGIN CUSTOM PANEL WITHOUT PORT
RewriteEngine On
RewriteRule ^(.*)$ HTTPS://panel.my-domain.com:2083/$1 [P]
END CUSTOM PANEL WITHOUT PORT
This way, the panel loads without port issues.
Configuring DNS in QuicCloud
- Navigate to QuicCloud → DNS Zone → Add New Record. Choose Type A, set the host as panel, and point it to your server IP.
- Then open Settings > Domain Alias and add your alias (example: panel.my-domain.com).
- Inside MyDomain > CDN Config, toggle Bypass CDN on and off. Reverify DNS, and within 5–10 minutes the status should be OK.
Optional Security – Restrict Panel Access
For added protection, restrict panel access to your IP in the .htaccess:
BEGIN PROTECT PANEL
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.[0-255]
RewriteRule ^.*$ - [F,L]
END PROTECT PANEL
Setting Hostname for Postfix and Dovecot
Run the following to set hostname:
hostnamectl set-hostname server.domain.com
postconf -e ‘myhostname = your.hostname.here’
Update these files with the new hostname:
- /etc/hosts
- /etc/mailname
- /etc/dovecot/dovecot.conf
Check with:
grep -ril cyberpanel.example.com /etc/
If IPv6 is active, also add your hostname to the ::1 localhost line in /etc/hosts.
For a quick route, run:
HostName='your.hostname.here' ; hostnamectl set-hostname ${HostName} ; postconf -e "myhostname = $(hostname)"; echo $(hostname) > /etc/hostname ; echo $(hostname) > /etc/mailname;
Restart services:
systemctl restart postfix||service postfix restart && systemctl status postfix -l||service postfix status; systemctl status postfix -l||service postfix status; systemctl restart dovecot||service dovecot restart; systemctl status dovecot||service dovecot status;
Monitor logs while sending/receiving mail:
tail -f /var/log/{maillog,exim_mainlog,exim_rejectlog,mail.log,mail.err,syslog} 2> /dev/null | grep -vEi 'Firewall|ftp'
Persisting Hostname Across Reboots
On some cloud servers, DHCP resets hostname. To persist, use:
vpsname="your.hostname.here"; echo "hostnamectl set-hostname ${vpsname}" >> /etc/rc.d/rc.local
Or via root crontab:
@reboot hostnamectl set-hostname your.hostname.here
Final Touch – Hostname SSL
Lastly, go back to CyberPanel, pick your domain in Hostname SSL, and click Issue SSL. From here, you can now access CyberPanel at:
https://domain.tld:8090
Replace domain.tld with your domain name.
[If needed, Our team is available 24/7 for additional assistance.]
Conclusion
Carrying out a CyberPanel change hostname involves precise edits and DNS checks, but once configured, it ensures smoother access and proper mail server identity. With SSL in place and Postfix/Dovecot updated, your panel is ready for secure use. By following these steps, you’ve completed a proper CyberPanel change hostname setup from start to finish
0 Comments