First login to the server via SSH. Then run:
Update the hosts file – Look for the primary IP of the server. Follow the same format and replace the old hostname with the new hostname on the same line as the primary IP.
Update your network file with the new hostname: