How to Change the Hostname on Windows Server 2022 and 2025

change hostname windows server 2025

Changing the hostname of a Windows Server is a common administrative task that can be done using various methods. This guide will walk you through the steps to change the hostname on Windows Server 2022 and 2025 using both the graphical user interface (GUI) and PowerShell.

Prerequisites

  • Administrative privileges on the server.
  • Access to the server either physically or via remote desktop.

Method 1: Using the Graphical User Interface (GUI)

Steps:

  1. Open Server Manager:
    • Click on the Start menu.
    • Select Server Manager.
  2. Access Local Server:
    • In the Server Manager dashboard, click on Local Server in the left-hand pane.
  3. Change Computer Name:
    • In the Properties section, click on the current Computer Name.
    • The System Properties window will open. Click on the Change button.
  4. Enter New Hostname:
    • In the Computer Name/Domain Changes window, enter the new hostname in the Computer name field.
    • Click OK.
  5. Restart the Server:
    • You will be prompted to restart the server. Click Restart Now to apply the changes.

Verification:

  • After the server restarts, open Server Manager again and verify that the new hostname is displayed under Local Server.

Method 2: Using PowerShell

Steps:

  1. Open PowerShell:
    • Click on the Start menu.
    • Type PowerShell and select Windows PowerShell.
  2. Run Rename-Computer Command:
    • In the PowerShell window, type the following command:Rename-Computer -NewName "NewHostname" -Force -PassThru
    • Replace "NewHostname" with the desired hostname.
  3. Restart the Server:
    • To apply the changes, restart the server using the following command:Restart-Computer

Verification:

  • After the server restarts, open PowerShell and run the following command to verify the hostname:hostname

Additional Tips

  • Ensure that the new hostname complies with your organization’s naming conventions.
  • If the server is part of a domain, you may need to update the DNS records to reflect the new hostname.
  • Always perform these changes during a maintenance window to avoid disrupting services.