In this article, we will teach you how to change domain name on Windows Server 2022. One of the prime functions of Windows Server 2022 is to act as a domain controller so that the objects (users, computers, etc.) of the domain have a central unit to access services and act as administrators. We are able to provide management for each of them through policies, roles, and services. Visit the Woshub website to learn in detail how to change a domain name.
A task that isn’t very common but that can happen is the need to change the domain name, whether for an update of the organization name, the sale of the company, legal adjustments, etc., but this method requires some steps. Which we will explore in this article and thus accurately change the domain name in Windows Server 2022.
Table of Contents
Change Domain Name
First, we will need to check the current domain name in the Server Manager.

Click on the Tools tab, and then DNS.

In the DNS manager console, we will right-click on “forward lookup zones,” and in the options displayed, we will choose “New zone.”

Welcome to the new zone wizard. Choose next.

Leave the zone type (primary zone) selected, and then choose next.

On the Active Directory zone replication scope page, choose the box “To all DNS servers running on domain controllers in this domain: jamiltech.local and choose next.

In the zone name window, we enter the name of the new domain and choose next.

Dynamic update: choose the box Allow only secure domain updates… and click next.

Verify the new zone wizard summary and click Finish.

Now you can see “newdomain.local” in the DNS manager.

How to Generate Random List
Search the command prompt and then run an administrator.

In the console, enter the below command to generate a domain list.
rendom / list

The above command will create a file with the registered domains. You can see this file on the C: drive.

We open the file and see the content.

Now we open the domain list file with Notepad for editing. Click on the Edit menu and choose Replace.

We need to change the name of the current domain to the new domain. Type the existing domain and the new domain (newdomain) and click Replace All.

Finally, replace the current domain name with the new domain in the NetBiosName line. Apply the changes.

Go back to the command prompt and then type the below command.
random /showforest
This command will show the structure of your new domain that we have registered.

Now we run the following command to update this information:.
rendom / upload

This is the time to prepare the domain name change by entering the following command:
rendom / prepare

Enter the below command to execute the script.
Random /execute
Verify the script was executed successfully.

You are about to be signed out; click on Close.” The server will restart.

On the Windows Server 2022 login screen, we need to select the option “other user.” There, we login with the new domain and user.

How to Fix Domain Name Dependencies in Group Policy Objects
After logging in, access the CMD as an administrator.

To fix domain name dependencies in Group Policy Objects, enter the below command.
Gpfixup /olddns:jamiltech.local /newdns:newdomain.local

We renamed the databases.

To clean up loose processes, type the following command:.
rendom / clean

Finally, complete the process with the below command.
rendom / end

How to Verify New Domain
In the server manager, go to the Tools tab and open “Active Directory Users and Computers”.

Verify the new domain.

Also verify active directory domains and trusts.

This has been the method for changing the domain name in Windows Server 2022.