en
  English
Phone :  +370 (5) 204-1903
Email :  sales@1gbits.com
  1. Dedicated server
  2. Blog
  3. How to change Hostname in Windows Server

How to change Hostname in Windows Server

A hostname is a unique identifier for a device in a network. You might sometimes need to change the existing hostname of your machine. This article will discuss two ways to do this task: through GUI and Powershell. This article has been written from the Windows Server 2019 version. However, feel free to follow the same steps on the 2016 and 2012 R2 versions.

Windows Server Jan 24, 22 by Nisal N 2 min Read
How to change Hostname in Windows Server

What is hostname

A hostname is a one-of-a-kind name or label associated with a device connected to a computer network. It makes it easier to distinguish between different machines or devices that are connected to the Internet, a network, or both. The naming system is used to allocate and assign hostnames.

A hostname can be alphabetic or alphanumeric, and it can contain a limited number of symbols that are used to identify a specific network node or device. The syntax and requirements of a hostname differ depending on the naming system in use. A hostname, for example, should have the top-level domain name (TLD) and should be in the range of [1, 63] characters long when used in the Domain Name System (DNS) or on the Internet.

Steps to change the hostname (using GUI)

Step 1

Go to Control Panel -> System and Security -> System and select the Change Settings option.

Alternatively, you can right-click This PC from the start menu, select Properties and select the Change Settings option.

A dialogue box named System Properties will pop up after either of the above steps.

Step 2

Click on the Change button to get a new dialogue box to enter the new hostname.

Step 3

Once you have inserted the new name, click OK to apply the changes and again click OK to restart the computer.

When the machine is up again, you will see the hostname updated.

Steps to change the hostname (using Powershell)

Run the following command in the PowerShell:

Rename-Computer -NewName "MyNewName" -Restart

-Restart parameter will restart the machine after changing the name.

To verify if the name was changed:

$env:computername

Conclusion

In this article, we discussed two ways to update the hostname of the Windows server. The GUI approach is easier to understand and is helpful for novices, while the Powershell approach is less frequently used as it requires knowledge of the command-line interface.

author img

Nisal N

Computers has always fascinated me since I was a kid and here we are. I love travelling for 2 reasons: the first one to see a new part of the world and second (the most important one) to experience the rich culture hidden among the country and people. I'm pretty good at cooking but very poor when it comes to baking.

Leave A Comment