In this example the computer name is Server-01 and I want to create another name called Server

netdom computername Server-01 /add:Server

Do this to remove the second name:

netdom computername Server-01 /remove:Server

I kept getting an error saying the system cannot open the device or file specified when removing a name from an old DC and adding the same name to a new DC.

Example:

  • Old domain controller named DC-1 has a secondary name of PDC
  • New domain controller named DC-01 and I want to move PDC to this server

Remove PDC from DC-1

netdom computername DC-1 /remove:PDC

Shut down DC-1

On the new domain controller open Active Directory Users and Computers and enable Advanced Features from the View menu

DC-1 is located in Domain Controllers OU for me so I go there and double click DC-1 and click Attribute Editor and find servicePrincipalName and double click it

Now find anything with PDC and Remove the item. For me there was 11 of them but here is sample of what I saw:

Now on the new domain controller DC-01 I did the following and it was successful:

netdom computername DC-01 /add:PDC

For some reason on the old server the SPNs kept coming back so I left it off for a while to see if the issue finally resolves. Here is how to see what is listed from cmd:

setspn -l dc-1

References:

Using Computer Name Aliases in place of DNS CNAME Records – Microsoft Tech Community

Setspn | Microsoft Docs