Login to WHM
Search for ‘Change Hostname’ in the left menu pane and click on it.
You can see your current hostname as shown below.
Type your new hostname in the box under ‘Change Hostname’
Click ‘Change’

This is how we can change the server hostname from WHM.