November 21, 2024

Mind of Marcuzio

Performance tuning is the art of wasting ten days to save ten seconds.

How to Rename a Domain Controller Correctly.

Difficulty Level    

ProTip: If you rename your Domain Controller like a normal computer by right-clicking on “This PC” and going to Properties, you’re gonna have a bad time…You will mostly have irreversible damage done to your metadata. Sure you could go through the trouble of demoting your DC renaming it using the above mentioned way and then promoting the server back to a DC. But the solution below is way easier and faster.

If you do this while the server is in production any clients using DNS, DHCP and File Services & Print Management will be impacted. I’d suggest either having a secondary DC setup or if it’s a standalone DC, do it after hours.

Do all of the following steps from a command line. If you don’t know where to locate the command line, you shouldn’t be working on a domain controller, let alone renaming it.

We are going to use a fictitious server called OldServer and rename it to NewServer on a domain called Domain.Local. FQDN’s are required on these commands. If not obvious, replace OldServer, NewServer & Domain.Local with your information.

  1. Add an alternate computer name to the DC you wish to rename:

netdom computername OldServer.Domain.Local /add:NewServer.Domain.Local

2. Verify that it worked even if it said it did:

netdom computername OldServer.Domain.Local /enumerate

You should see both OldServer.Domain.Local and NewServer.Domain.Local listed.

3. Make the new name the primary:

netdom computername OldServer.Domain.Local /makeprimary:NewServer.Domain.Local

4. Reboot the server:

shutdown /r /t 0

5. Check the new server name:

hostname

The new name that you made the primary name should be the only one listed.

6. Remove old hostname:

netdom computername NewServer.Domain.Local /remove:OldServer.Domain.Local

7. Run dcdiag to make sure everything is cool

8. Final To Do’s:

Update any UNC paths to shares, logon scripts etc in GPO or other places you may have them. Also verify that all your DNS records were updated.

About The Author