Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Active Directory / How to Rename an Active Directory Domain

November 17, 2026

How to Rename an Active Directory Domain

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.

Instead of performing a direct AD domain rename, several safer alternative workarounds can be implemented.

  • 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 UserPrincipalName of 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

create DNS primary zone for new AD domain

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.

rendom /list command used to generate Domainlist.xml

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

rename the domain in the Domainlist.xml Active Directory configuration file

Save the file and run this command:

rendom /showforest

The command will show the changes to be made in the configuration.

rendom /showforest - show ad configuration changes

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

rendom /upload - upload new domain name to AD

Once this file has been uploaded, the forest configuration will be locked until the renaming process is either completed or cancelled.  You will not be able to add or remove domain controllers, make schema changes, or configure trust relationships. Any changes to the AD forest configuration will be rejected.

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.

rendom /prepare - prepare for domain renaming

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

rendom /execute - apply the new domain name

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.
The overall domain rename process for each domain controller can be tracked using the dclist.xml file. It is automatically created in the current directory after the rendom /upload command is run.

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.

new domain name in the computer properties

After the DC reboots, you must specify an account name in the format 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.

logon to DC under new domain account

After the DCs come back online, run the following command to update GPO dependencies and links:

gpfixup /olddns:test.com /newdns:resource.loc

gpfixup - fix GPO bindings

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.

Change primary DNS suffix when domain membership changes

Before proceeding to the next step, be sure to reboot all the domain workstations and member servers. This must be done after /execute and BEFORE running the rendom /clean command.  Any workstations or servers that have not been rebooted twice before the next stage begins will lose their trust relationship with the domain and will have to be manually rejoined to the new domain.

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.

domain rename completed successfully

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.
Note that you will have to do some extra steps to reconfigure some services (like Certificate Services, Failover Clusters) for a new domain.

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
9
Facebook Twitter Google + Pinterest
Active DirectoryWindows Server 2019Windows Server 2022Windows Server 2025
previous post
Using Out-GridView to View and Select Table Data in PowerShell
next post
Run a Script (Program) When a Specific Program Opens/Closes in Windows

Related Reading

Checking Active Directory Domain Controller Health and Replication

May 15, 2025

How to Refresh (Update) Group Policy Settings on...

March 24, 2026

Configuring Windows Firewall Rules Using Group Policy

November 25, 2026

Configure Proxy Server Settings in Windows via Group...

August 24, 2026

Repairing the Domain Trust Relationship Between Workstation and...

February 19, 2026

Troubleshooting: Group Policy (GPO) Not Being Applied to...

August 13, 2026

How to Find Inactive Computers and Users in...

March 24, 2026

Deploying Printers to Domain Users and Computers with...

May 21, 2025

13 comments

David November 4, 2022 - 10:52 am

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?

Reply
admin November 16, 2022 - 8:48 am

Of course, you need to use gpfixup command to fixes domain name dependencies in Group Policy Objects and Group Policy links, but you can skip the NetBIOS name change step.

Reply
Mahesh December 3, 2022 - 3:00 pm

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

Reply
admin December 9, 2022 - 1:59 pm

Can you try to access to the GPMC if you choose “Remove this domain from the console” and selecting the new domain?

Reply
Tushar March 15, 2023 - 3:34 pm

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.

Reply
Chitharthan R September 22, 2025 - 4:19 am

I’m having the same confusion. Was your point clarified?

Reply
Soner March 26, 2023 - 6:26 pm

Error please Fix Bro: (

Reply
Avi February 8, 2024 - 3:02 pm

Great instructions, very helpfull. Thanks

Reply
Jarek December 1, 2024 - 11:15 am

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?

Reply
admin December 3, 2024 - 7:48 am

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 –Verbose
nltest /dnsgetdc:mydomain.com
nltest /DSGETDC:mydomain.com
nltest /sc_query:mydomain.com

Reply
srg December 12, 2024 - 4:54 am

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.

Reply
Seth January 12, 2025 - 8:03 pm

Instructions are clear and to the point. This really worked for me! Thank you.

Reply
Luigi January 14, 2025 - 2:50 pm

You’re the man, this isn’t the first post I read here and they are always great, thanks for your work!

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Managing PowerShell Modules in Windows: Install, Update & Remove

    November 24, 2026
  • Windows Installer Folder Too Large? How to Clean Up Safely

    November 12, 2026
  • Shrink WSL2 and Docker Desktop VHDX Files in Windows

    November 11, 2026
  • We Can’t Sign In to Your Account: Fix Temporary User Profile in Windows

    October 20, 2026
  • Backup/Sync to Cloud Storage with Rclone on Windows

    October 9, 2026
  • Fix Missing “Yes” Button in User Account Control Prompt on Windows

    October 7, 2026
  • Block Specific Keyboard Shortcuts with Keyboard Filter on Windows

    October 3, 2026
  • How to Set Task Priority in Windows Task Scheduler

    September 22, 2026
  • AutoStart Program at RDP Logon in Windows RDS

    September 8, 2026
  • How to Convert Windows Machine into a Proxmox VM

    August 30, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • Best Practices: Changing the IP Address on a Domain Controller
  • How to Find AD Users with Blank Passwords (Password-Not-Required)
  • How to Create a User Account Without a Password on Windows
  • Using KDC (Kerberos) Proxy in AD for Remote Access
  • Change Default OU for New Computers and Users in AD
  • AD Domain Join: Computer Account Re-use Blocked
  • Collecting Windows and Active Directory Event Logs with Graylog
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top