Step 2

Tidy up DNS

Each DC registers its new records by itself. Some records for the old names are left behind, and one never updates at all. Check the new records first, then delete the old ones.

15 minutesRun as a domain admin on CON-DC-01
New before old

Domain controllers find each other through DNS. Never delete an old record until you have seen the new one in its place.

Make every DC register again

CON-DC-01
$dcs = (Get-ADDomainController -Filter *).HostName
Invoke-Command -ComputerName $dcs -ScriptBlock { nltest /dsregdns | Out-Null; ipconfig /registerdns | Out-Null }
Start-Sleep -Seconds 90

Check the new names are in DNS

CON-DC-01
Resolve-DnsName -Type SRV _ldap._tcp.dc._msdcs.ad.contoso.com | Where-Object Type -eq 'SRV' | Format-Table Name, NameTarget -AutoSize
Get-DnsServerResourceRecord -ZoneName _msdcs.ad.contoso.com -RRType CName |
    Format-Table HostName, @{n='PointsTo';e={$_.RecordData.HostNameAlias}} -AutoSize

The first table should list every DC by its new name. The second should show one row per DC, each pointing at a new name. Do not go on until both are right.

List what still mentions the old names

Change *srv-dc* to match your old names. This only lists records.

CON-DC-01
$old = '*srv-dc*'
Get-DnsServerZone | Where-Object { -not $_.IsAutoCreated -and $_.ZoneType -eq 'Primary' -and $_.ZoneName -ne 'TrustAnchors' } | ForEach-Object {
    $z = $_.ZoneName
    Get-DnsServerResourceRecord -ZoneName $z | Where-Object {
        $d = $_.RecordData
        ($_.HostName, $d.NameServer, $d.HostNameAlias, $d.DomainName, $d.PtrDomainName -join ' ') -like $old
    } | Select-Object @{n='Zone';e={$z}}, HostName, RecordType,
        @{n='Data';e={ $d = $_.RecordData; ($d.NameServer, $d.HostNameAlias, $d.DomainName, $d.PtrDomainName, $d.IPv4Address | Where-Object { $_ }) -join ' ' }}
} | Format-Table -AutoSize

Expect the old address records, an _msdcs name server record, and some service records. Many clear by themselves within ten minutes, so the list gets shorter if you wait.

Fix the name server record

The _msdcs name server record was written when the domain was created and never updates by itself. Add the new names.

CON-DC-01
foreach ($ns in 'con-dc-01.ad.contoso.com.','con-dc-02.ad.contoso.com.') {
    Add-DnsServerResourceRecord -ZoneName ad.contoso.com -Name _msdcs -NS -NameServer $ns -ErrorAction SilentlyContinue
}

Delete the old records

CON-DC-01
$removed = 0
Get-DnsServerZone | Where-Object { -not $_.IsAutoCreated -and $_.ZoneType -eq 'Primary' -and $_.ZoneName -ne 'TrustAnchors' } | ForEach-Object {
    $z = $_.ZoneName
    Get-DnsServerResourceRecord -ZoneName $z | Where-Object {
        $d = $_.RecordData
        ($_.HostName, $d.NameServer, $d.HostNameAlias, $d.DomainName, $d.PtrDomainName -join ' ') -like $old
    } | ForEach-Object { Remove-DnsServerResourceRecord -ZoneName $z -InputObject $_ -Force; $removed++ }
}
"Records removed: $removed"
Invoke-Command -ComputerName $dcs -ScriptBlock { nltest /dsregdns | Out-Null }
Start-Sleep -Seconds 60

The last two lines make each DC register again, in case a record it needs was caught.

Final check

Run the listing from step 3 again. It should return nothing. Then:

CON-DC-01
Get-DnsServerResourceRecord -ZoneName ad.contoso.com -Name _msdcs -RRType NS | Format-Table HostName, @{n='NameServer';e={$_.RecordData.NameServer}} -AutoSize
Resolve-DnsName -Type SRV _gc._tcp.ad.contoso.com       | Where-Object Type -eq 'SRV' | Format-Table Name, NameTarget -AutoSize
Resolve-DnsName -Type SRV _kerberos._tcp.ad.contoso.com | Where-Object Type -eq 'SRV' | Format-Table Name, NameTarget -AutoSize
repadmin /replsummary
dcdiag /test:DNS /q

Each table should list the new names only. Replication should show 0 failures, and the last command should print nothing.

Update everything on your list

Go back to the list from Check you are ready and change each backup job, script, mapped drive and device to the new names. Update your own documentation too.

Done when

Check

No DNS record mentions the old names, every service record lists the new names, and replication shows 0 failures.

Your progress is kept in this browser only.