Changing IP and Computer Name of a Domain Controller


Sometimes it is necessary to change the IP address assigned to a domain controller, especially if you want to change the network address or after a Server Migration.

First, you may need to check the DC health by executing the DCDIAG command (always run as Administrator)

Then, you can change the IP address as necessary;

Now the IP address has been changed, we need to empty the local DNS cache and register the DC’s new IP address in DNS.

  1. In the PowerShell box, run ipconfig /flushdns to remove any cached DNS entries created by the local DNS resolver.
  2. Run ipconfig /registerdns to ensure the new IP address is registered by the DNS server.
  3. Run dcdiag /fix to update Service Principal Name (SPN) records and check that all the tests are passed successfully.

If you have a distributed AD DS / DNS infrastructure, you may need to wait for DNS information to replicate or force a replication. If present, sub-net information in AD Sites and Services should be updated if the subnet addressing scheme is also modified.

Changing the Hostname as necessary;

Renaming a DC by using netdom commands is the preferred method. It requires that the domain functional level be at least Windows Server 2003.

  1. Open an administrative command prompt.
  2. Type netdom computername /add:.
    For example, if you are renaming a DC from OldDC01 to NewDC01, you would type netdom computername OldDC01 /add: NewDC01
    This command adds a second entry to the list of computer names used by the DC.
  3. Type netdom computername /makeprimary:.NewDC01
    This command designates the new name as the DC's primary computer name.
  4. Reboot the server.
  5. When the server comes back up, open an administrative command prompt.
  6. Type netdom computername /remove: OldDC01
    This command removes the old name from the list of computer names used by the DC.

To update the FRS or DFS-R member object, perform the following steps;

  1. Open Active Directory Users and Computers.
  2. From the View menu, select Advanced Features.
  3. If SYSVOL is replicated using the File Replication System:
    Expand System > File Replication Service > Domain System Volume (SYSVOL Share).
    If SYSVOL is replicated using Distributed File System Replication (DFS-R):
    Expand System > DFSR-GlobalSettings > Domain System Volume > Topology.
  4. Right-click the object corresponding to the DC's old name and select Rename.
  5. Type the DC's new name and hit Enter.

DISM to fix issues that SFC can’t


SFC, which stands for System File Checker, is a built-in administrative tool to verify the integrity of operating system files and to repair files that are corrupt, damaged or changed.

SFC scans have three possible outcomes:

  1. The scan did not find any issues.
  2. The scan did find issues and fixed them.
  3. The scan did find issues and couldn't repair them (Windows Resource Protection found corrupt files but was unable to fix some of them).

Note: It is recommended that you do a full backup of the Windows system partition before you run DISM.

SFC may also correct issues but it may not resolve the issue that you tried to correct in first place by running it.

DISM comes to the rescue in these situations. Deployment Image Servicing and Management (DISM)  is a command line program for Windows that is used for a variety of purposes.It is available in all versions of Windows starting from Windows 7 and Windows Server 2008.


Plesae always run the DSIM commands with elevated privileges.

Command 01: Dism /Online /Cleanup-Image /CheckHealth – Run this to check status

The command checks the image for the corruption flag and returns its findings to you but does not run repair operations.

Command 02: Dism /Online /Cleanup-Image /ScanHealth – Run this to check component store corruptions

The scan takes longer to complete if corruption is found during the scan of the image.

Command 03: DISM /Online /Cleanup-Image /RestoreHealth – Run this to fix the corruption

The /RestoreHealth parameter runs a scan for corruption and attempts to repair any issues that it finds automatically.