In this short article, we’ll show you how to properly rename an Active Directory domain from test.com to resource.loc. The domain rename procedure described here has been tested in practice and can be used relatively safely in small, simple, or test AD DS deployments.
- For large, complex Active Directory infrastructures, it is generally preferable to create a parallel AD forest, establish trust relationships, and migrate existing policies, users, computers, servers, and other objects to it gradually. Tools such as ADMT and USMT can be used to migrate to the new domain.
- In many cases, it may be sufficient to add a UPN suffix for the new domain to the existing one and change the
UserPrincipalNameof users, rather than changing the domain name completely.
Before you start domain renaming, make sure that:
- You have an up-to-date backup of your domain controllers.
- AD replication works correctly in your domain, and there are no critical domain controller or DNS errors in your environment (How to check the Active Directory health).
- There are no Exchange servers in your domain. You cannot rename an AD domain with Exchange Server deployed (except for Exchange Server 2003).
- The domain functional level is at least Windows Server 2003 (in my example, both the domain and forest functional levels are Windows Server 2019).
- You have an account that is a member of the Enterprise Admins
First of all, create a DNS zone for your new domain on your existing domain controllers. To do it, open thednsmgmt.msc snap-in, create a new primary Forward Lookup Zone with the name resource.loc, and replicate it on all the DNS servers in your current test.com domain. You can create a new DNS zone using PowerShell:
Add-DnsServerPrimaryZone -Name resource.loc -ReplicationScope "Domain" –PassThru
Wait until the new zone has been replicated to all DCs.
Run the rendom /list command to generate the Domainlist.xml file with the current AD forest configuration.
Get-Content .\Domainlist.xml
<Forest> <Domain> <!-- PartitionType:Application --> <Guid>6944a1cc-d79a-4bdb-9d1b-411fd417bbbc</Guid> <DNSname>DomainDnsZones.test.com</DNSname> <NetBiosName></NetBiosName> <DcName></DcName> </Domain> <Domain> <!-- PartitionType:Application --> <Guid>bb10d409-4897-4974-9781-77dd94f17d47</Guid> <DNSname>ForestDnsZones.test.com</DNSname> <NetBiosName></NetBiosName> <DcName></DcName> </Domain> <Domain> <!-- ForestRoot --> <Guid>b91bcb80-7cbc-49b7-8704-11d41b77d891</Guid> <DNSname>test.com</DNSname> <NetBiosName>TEST</NetBiosName> <DcName></DcName> </Domain> </Forest>
Open the Domainlist.xml and replace all the old domain names with the new ones:
Notepad .\Domainlist.xml
Save the file and run this command:
rendom /showforest
The command will show the changes to be made in the configuration.
The following command will upload the new AD partition configuration in Domainlist.xml to the domain controller holding the Domain Naming Master FSMO role.
rendom /upload
Wait for the replication to finish across the entire forest. To speed up replication, use the following command:
repadmin /syncall
The next command, rendom /prepare will check the availability of all DCs in the forest and confirm whether they are ready for the rename operation.
Make sure that the command has not returned any errors and that all DCs report that they are ready.
Waiting for DCs to reply. mun-dc02.test.com was prepared successfully mun-dc01.test.com was prepared successfully msk-dc00.test.com was prepared successfully 3 servers contacted, 0 servers returned Errors The operation completed successfully.
The command below will perform a domain rename. The domain controllers will be unavailable for a short time while the new configuration is applied, after which they will restart automatically.
rendom /execute
Waiting for DCs to reply. The script was executed successfully on mun-dc02.test.com The script was executed successfully on mun-dc00.test.com 2 servers contacted, 0 servers returned Errors The operation completed successfully.
After rebooting, check that the new domain name is displayed in Computer Properties on the DCs. Note that the computer’s full name (FQDN) didn’t change at this stage.
newdomain\username to log in to the DC (by default, the old domain name will be shown on the sign-in screen). On Windows Core domain controllers, you can specify a different username by pressing the ESC key several times.After the DCs come back online, run the following command to update GPO dependencies and links:
gpfixup /olddns:test.com /newdns:resource.loc
Group Policy fix up utility Version 1.1 (Microsoft) Start fixing group policy (GroupPolicyContainer) objects: Start fixing site group policy links: Start fixing non-site group policy links: gpfixup tool executed with success.
Then update the NetBIOS domain name:
gpfixup /oldnb:TEST /newnb:RESOURCE
In order to switch all client workstations and member servers to the new domain, they must be restarted twice. For workstation DNS suffixes to be updated automatically, the Change primary DNS suffix when domain membership changes option must be enabled: Computer Properties (sysdm.cpl) -> Computer Name -> More.
The command below will remove any remaining links to your old domain from the AD.
rendom /clean
To finalize the process, unlock the domain configuration and allow further changes by running:
rendom /end
The domain controllers still have the old domain suffix configured. You now need to manually add the new alternative FQDN names to each domain controller and then make them the primary names. Open a command prompt and run the following commands on each DC:
netdom computername %COMPUTERNAME%.test.com /add:%COMPUTERNAME%.resource.loc
netdom computername %COMPUTERNAME%.test.com /makeprimary:%COMPUTERNAME%.resource.loc
Restart each DC:
Shutdown –f –r –t 0
Open the Active Directory Users and Computers (dsa.msc) console and make sure that it has connected to the new domain name and that the entire OU structure, including users and computers, remains in place.
After renaming the domain, you may need to check and reconfigure a few more things:
- Check and update the UPN suffix for users. The userPrincipalName attribute should reference the new domain.
- If the domain DFS namespaces reference the old domain name, you must update these paths.
- Authorize DHCP servers in the new domain.
- If your GPOs contain configured roaming profile or folder redirection settings, verify that they reference the new domain name.
Once you have completed the domain rename, check the AD replication status and review any errors on the DCs (see the link above). Once everything is functioning as expected, you can delete the DNS zones for the old domain (test.com and _msdcs.test.com).










13 comments
Firstly – great post! I need to rename my FQDN, and this seems to be the clearest instructions I’ve found.
As for my question… I intend to rename my current AD domain name from companyname.local (NetBIOS name: companyname) to local.companyname.com (NetBIOS name: companyname).
Assuming this is OK, would I just need to skip the command ‘gpfixup /oldnb:TEST /newnb:RESOURCE’ in your instructions?
Of course, you need to use
gpfixupcommand to fixes domain name dependencies in Group Policy Objects and Group Policy links, but you can skip the NetBIOS name change step.I got an error while opening group policy manager.
How to fix it please advice.
Athough I did gpfixup command but still same.
Once I get any reply I will post you the screen shot of error
Thanks
Can you try to access to the GPMC if you choose “Remove this domain from the console” and selecting the new domain?
Only domain controllers need to be manually renamed. The rest of the computers and servers can be rebooted twice and they will automatically switch to the new domain.
This must be done after /execute and BEFORE executing the rendom /clean command.
I clearly understand above statement from you. I have one question as below
During active directory rename, Can all my client computers be in disconnect state(not connected to network) and once i am done with /execute can I connect all these client computers to network and reboot them twice and they will automatically switch to the new domain.
I am asking this question as i am planning to perform active directory rename early morning when users will not be in office and once they are in office I plan to connect their computers to network and reboot them twice so that they automatically switch to new domain.
I’m having the same confusion. Was your point clarified?
Error please Fix Bro: (
Great instructions, very helpfull. Thanks
Hello. Great guide:-)
I have a question. I have renamed my domain, and it’s all OK here. I’m after /execute and rebooting member servers. But RDP on all servers is failing with NLA error (domain cannot be contacted). But when I go to the VM console, the login works OK. And, then I can do an RDP connection.
Any ideas?
By default, NLA uses Kerberos for authentication when the client and server are part of the same AD domain.
It looks like there are some AD connectivity issues on clients.
Verify the client’s trust relationship (secure channel) with the domain:
Test-ComputerSecureChannel –Verbosenltest /dnsgetdc:mydomain.com
nltest /DSGETDC:mydomain.com
nltest /sc_query:mydomain.com
Thanks for posting! This guide is absolutely simple and clear.
I suggest you add the info that the rename status on all DCs can be tracked in the DcList.xml file, which is automatically generated and updated by rendom.exe. The fist stage is Initial.
Instructions are clear and to the point. This really worked for me! Thank you.
You’re the man, this isn’t the first post I read here and they are always great, thanks for your work!