Changing your servers hostname will invalidate your cPanel license. If you want to change server hostname and need to access WHM/cPanel, then do the following:
1. SSH to the server (as the root user) and change the hostname.
2. Then run the command /usr/local/cpanel/cpkeyclt.
This will update the license file with your current hostname, and push the change to cPanel’s license verification servers auth.cpanel.net and verify.cpanel.net.