Changing the IP address and host name of a domain controller

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.

Changing the IP address and host name of a domain controller

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

Change 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:

Check DNS

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

Delete old entries from DNS

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:

Check DNS
Check reverse pointer

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
Add new DNS name

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
Rename domain controller

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
Delete old hostname

The renaming of the domain controller is now complete:

Check new host name

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

Check DNS

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

Delete old entries from DNS

It is best to go through all zones again and check for old entries.

10 thoughts on “IP-Adresse und Hostname eines Domain Controller ändern”

  1. 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!

    Reply
  2. 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

    Reply
  3. Vielleicht sollte man noch die FSMO-Rollen erwähnen und diese ggf. vorher umziehen und nachher zurückziehen …

    Reply

Leave a Comment