You can change hostname of your server from WHM by following the below steps:
1. Login to WHM
2. Search for 'Change Hostname' in the left menu pane and click on it.
3. You can see your current hostname as shown below
4. Type your new hostname in the box under 'Change Hostname'
5. Click 'Change'