Sometimes it may be necessary to subsequently change the IP and host name of a domain controller, for example if a new domain controller replaces an old one and is to be accessible under the same IP and name.
Changing the IP address of a domain controller is normally no problem, but changing the hostname of a domain controller requires a different procedure. In case anyone needs it, here is a short article about it. I have created a small test environment with the domain controller DC1 and the IP 172.16.16.150. DC1 is renamed here to DC2 and gets the IP 172.16.16.151.

As already mentioned, changing the IP is possible without any problems; the old IP is simply replaced with the new IP:

After changing the IP address, the DNS cache is cleared once and the new IP is registered in the DNS with the following command:
ipconfig /flushdns && ipconfig /registerdns
After the IP has been changed, the entries in the DNS should be checked once, entries with the old IP still appear here in various places, these can now be deleted if there are also entries with the corresponding new IP:

The entries with the old IP (in my case 172.16.16.150) can now be removed from all zones:

It is best to quickly check all zones here and delete the corresponding old entries. You should also check whether HOST-A and the corresponding PTR entry have been created with the new IP:


If these entries are missing, there was probably a problem registering the DNS entries. Before renaming the domain controller, you should check whether there are any problems with the DNS.
Renaming a domain controller works slightly differently to renaming a domain member. However, renaming is not difficult either. First, another name is added to the domian controller using the "netdom" command, the syntax is as follows:
netdom computername CurrentName.domain.local /add:NewName.domain.local
So in mine, I need to use the following command to add the name DC2 to DC1:
netdom computername dc1.ad.frankysweblab.de /add:dc2.ad.frankysweblab.de

Now the server can be renamed to the newly added names, the syntax is similar here:
netdom computername CurrentName.domain.local /makeprimary:NewName.domain.local
So in my case I can use the following command:
netdom computername dc1.ad.frankysweblab.de /makeprimary:dc2.ad.frankysweblab.de

A restart of the domain controller is now absolutely necessary, the reason is already given by the message after the above command has been executed.
Once the server has been restarted, the old host name can be removed:
netdom computername NewName.domain.local /remove:OldName.domain.local
In my case, it is the following command:
netdom computername dc2.ad.frankysweblab.de /remove:dc1.ad.frankysweblab.de

The renaming of the domain controller is now complete:

The DNS should also be checked again now to ensure that all entries really point to the new name:

If there are old entries, these can be deleted again:

It is best to go through all zones again and check for old entries.
Funktioniert das auch mit IP Bereichen? Also wenn ich eine komplette Domain in einen neuen IP-Bereich umziehe?
Sehr gute Anleitung.
Vielen Dank!
Geht das so ?
Aktuell gibt es domcon1, der soll ersetzt werden. Ich mache einen neuen DC domcon2.
Dann wird domcon1 heruntergestuft und umbenannt zu domcon_old
Dann mache ich aus domcon2 domcon1 wie in der Anleitung ?!
Danke!
Hallo Franky
ein Blick in Active Directory Sites and Services kann eventuell noch ein Überbleibsel von DC1 zeigen, der dann auch entfernt werden müsste. DIese Art von umbenennen hilft auch beim problemlosen Sync von Sysvol und sollte auch einem nachträglichen dcdiag standhalten. Danke für den Tipp.
Gruss
Romano
Ist das so offiziell von MS supportet ?
Hallo Mike,
jap. Die Vorgehensweise ist supported
„This command can safely rename Active Directory domain controllers as well as member servers.“
https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc772217(v%3Dws.11)
Gruß,
Frank
Danke.
Vielleicht sollte man noch die FSMO-Rollen erwähnen und diese ggf. vorher umziehen und nachher zurückziehen …
Hallo Henning,
das Verschieben der FSMO Rollen ist nicht erforderlich. Es könnte allerdings ein Problem mit der Replikation des Sysvols auftreten (wenn per DFSR repliziert wird), dies lässt sich aber ebenfalls einfach beheben:
https://docs.microsoft.com/en-US/troubleshoot/windows-server/identity/sysvol-msdfsr-member-container-not-updated (Workaround 3)
Gruß,
Frank
Super Anleitung, Danke