Step 1: Getting ready.
Open a command prompt. (Windows key + r, then run cmd)
Independent Studio
Technick
A practical rename procedure for a domain controller when the hostname needs to be corrected without turning the migration into unnecessary drama.
This walkthrough adds the new name as an alternate computer name, makes it primary, reboots, verifies the result, removes the old hostname, and finishes with validation and cleanup.
Source: Correctly Renaming A Domain Controller For A Seamless Easy Migration
Open a command prompt. (Windows key + r, then run cmd)
Syntax
netdom computername <currentDC FQDN> /add:<newDCName FQDN>
In the command prompt, type netdom computername wrongname.domain.local /add:server.domain.local.
This should return: 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.
Syntax
netdom computername <currentDC FQDN> /makeprimary:<newDCName FQDN>
Run netdom computername wrongname.domain.local /makeprimary:server.domain.local.
This command should return successfully and warn that you need to reboot immediately. That warning matters, especially if this is the only domain controller in the forest.
If the command is successful, you should get the expected confirmation message.
Pick your poison. I like shutdown /r /t 0 in the command prompt.
shutdown /r /t 0
Go to system properties and confirm the new computer name. Or run netdom computername server.domain.local /enumerate to see both active names.
netdom computername server.domain.local /enumerate
Syntax
netdom computername <newDCName FQDN> /remove:<oldDCName FQDN>
(remember, in a command prompt)
Type netdom computername server.domain.local /remove:wrongname.domain.local
netdom computername server.domain.local /remove:wrongname.domain.local
In cmd, run dcdiag to make sure everything is AOK.
If you use logon scripts, remember to update the UNC paths with the new server name.