Source: Correctly Renaming A Domain Controller For A Seamless Easy Migration (theictguy.co.uk)
Step 1: Getting ready.
Open a command prompt. (Windows key+r (run) + cmd)
Step 2: Adding an alternate computer name.
SYNTAX : netdom computername <currentDC FQDN> /add:<newDCName FQDN>
In the command prompt, type (minus quotes) “netdom computername wrongname.domain.local /add:server.domain.local“
This should return with “Added (NAME) as an alternate name for the computer. The command completed successfully.“
To check the name has applied correctly run “netdom computername server.domain.local /enumerate” you should then see there are two names listed.
Step 3: Make the new name the primary.
SYNTAX: netdom computername <currentDC FQDN> /makeprimary:<newDCName FQDN>
Type netdom computername wrongname.domain.local /makeprimary:server.domain.local
IMPORTANT: This command will return successful, and warn you that you need to reboot immediately, as it may not authenticate logons (very important if only DC in forest)
If the command is successful you will get the below message.
Step 4: Reboot the server.
Pick your poison. I like “shutdown /r /t 0” in the cmd.
Step 5: Check new server name.
Go to system properties and confirm new computer name. Or run “netdom computername server.domain.local /enumerate” to see both active names.
Step 6: Remove old hostname.
SYNTAX: netdom computername <newDCName FQDN> /remove:<oldDCName FQDN>
(remember, in a command prompt)
Type “netdom computername server.domain.local /remove:wrongname.domain.local“
Step 7: Paranoia.
in cmd, run a “dcdiag” to make sure everything is AOK.
Step 8: Clean up.
If you use logon scripts, remember to update the UNC paths with the new server name.