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.
Das Umbenennen eines Domain Controller funktioniert etwas anders, wie das Umbenennen eines Domain Member. Das Umbenennen ist aber auch nicht weiter schwierig. Zunächst wird dem Domian Controller ein weiterer Name hinzugefügt, dies passiert mit dem Befehl „netdom“, die Syntax ist wie folgt:
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.