Preface: I've only done this in a development environment, but I've done it twice and it worked pretty well.
Rename the Server
I did this the default Windows method, through PC info, as if it was any other machine rename.
Rename the SharePoint Server
Googling for how to do this led me this stackoverflow question which suggests using the PowerShell (SharePoint PowerShell) command
Rename-SPServer but luckily, one astute commenter let us know that if the server has already been renamed (which I had done the first time inadvertently), that you should use
stsadm. So, it appears that
Rename-SPServer might be the
correct way to do it, but I was successful with
stsadm. Run the command:
stsadm -o renameserver -oldservername <old server name> -newservername <new server name>
Then, to make sure SharePoint is aware of all the changes, take a run through the SharePoint Products Configuration Wizard and it will clean up repair any issues. See, it even says so:
Update Alternate Access Mappings
Open up your sharepoint central administration. There's a usually a start menu shortcut to it, but that one won't work until you complete this step. Just type your new server name into the address bar manually. Note that this is not the Server Farm Administration, but rather Central Administration for your SharePoint Server. My Farm Administration is at
http://<machine name>[:80] but my server's Central Administration is at
http://<machine name>:<some port assigned in configuration>.
Make sure you show all mappings, so you get them for all ports you have configured. Then just click on each one to rename it. The Internal/Public Urls should show your old server name. Just update it in the same format to your new server name.
Update Your Visual Studio Solution
If you have a Visual Studio solution that you're developing and debugging on this server, you'll have to update the Site URL so Visual Studio knows where to deploy. Select your project under the solution, then open the properties window (it's not under project properties you get if you right click the project and select properties, it's actually in the properties window). Then, update the Site URL. After that, you should be good to go.