Preparation
- This guide assumes you are running Windows server 2012 R2, 2016, or 2019
- You are using a single domain controller
- You want to rename your DC
Renaming your DC using netdom
Step 1: Open Command Prompt
Open command prompt as a domain administrator by pressing Windows Key
- Open the Start Menu
- Type CMD
- Right-Click on command prompt
- select Run as administrator
Step 2: Adding the new name to your DC using netdom
Enter the following command to suit your environment, replacing computer names appropriately. Make sure at each stage in this guide you use the FQDN.
netdom computername CURRENTNAME.DOMAIN.LOCAL /add:NEWNAME.DOMAIN.LOCAL
If the command was successful you should receive the following message: Added (NAME) as an alternate name for the computer. The command completed successfully.
Step 3: Verify the name was added successfully
Ensure the new name was added correctly, enter the following command. Make sure you use the CURRENT name of the computer, NOT the new name you have added.
If this was successful you should see both names appear in the list.
netdom computername CURRENTNAME.DOMAIN.LOCAL /enumerate
Step 4: Changing the primary DC name
Enter the following command to change the additional computer name to primary.
netdom computername CURRENTNAME.DOMAIN.LOCAL /makeprimary:NEWNAME.DOMAIN.LOCAL
You should receive a message stating that the change was successful and that you should now reboot the server.
Step 5: Reboot your server
Reboot your server by either going to the start menu and selecting restart or entering shutdown /r /t into the command prompt window.
Step 6: Verifying the name change
Once your server has been rebooted, open up command prompt and enter the following command using your new computer name, again you should see both of the names in the list.
netdom computername NEWNAME.DOMAIN.LOCAL /enumerate
Step 7: Removing the old hostname
Once you’ve verified that your computer responds to the new hostname, its time to remove the old name.
netdom computername NEWNAME.DOMAIN.LOCAL /remove:OLDNAME.DOMAIN.LOCAL
Step 8: Checking for issues
Run the following command to check to make sure everything on your DC is functioning correctly.
dcdiag