A “Hostname” or “Computer Name” is the identifier of your system inside a computer fnetwork. It distinguishes your system from another system and on a single network, there can be devices with duplicate hostnames. You need a “Hostname” to identify, locate, and connect with other users on a network. When the connection is established, you can share files with other users.

But, how can you find/view your computer system’s hostname? We recommend using the “hostname” command to find your computer’s hostname. 

Quick Outline

This guide discusses the use of the “hostname” command and other ways to find your hostname on Windows using the following content:

Let’s begin!

How to Use the hostname Command in Windows?

The “hostname” command lets you view your computer’s name or hostname. To use it, open up the Command Prompt/Windows PowerShell and run the “hostname” command as follows:


Note: There can be duplicate hostnames on a single network.

How to Find/View the System’s Hostname in Windows?

In Windows, you can find your “Hostname” using the “hostname” command, “System Information” utility, the “ipconfig /all” command, and the “Get-ComputerInfo (works on PowerShell only)”. 

Find Hostname | System Information Utility

The “System Information Utility” holds all the information about the Windows-operated system. To open it, open the “Run” and enter “msinfo32”. Next, select the “System Summary” tab and find the “Hostname” against the “System Name”, as seen below:

Find Hostname | ipconfig Command

The “ipconfig” is a network-related command but it can be used to display the “Hostname”. To view the “Hostname” using the “ipconfig” command, use the following command:

ipconfig /all

Find Hostname | echo Command

The “echo” command can also display/output the “Hostname” on Windows via the below signature:


Find Hostname | Get-ComputerInfo Cmdlet

The Windows PowerShell offers several “Cmdlets” and one of them is “Get-ComputerInfo” which displays the system properties. Execute this command with “-Property CsName” option to get the host name:

Get-ComputerInfo -Property CsName

Bonus Tip: How to Change the Hostname in Windows

Sometimes a user may need to change the hostname in Windows for several reasons, such as duplicate hostname, or any other reason. For this purpose, use the “Rename-Computer” cmdlet as follows:

Rename-Computer -NewName MyComputer

Note: Changing the system’s hostname requires a system reboot.

Final Words

The “hostname” command of Microsoft Windows shows the “Hostname” of a computer system. A “Hostname” acts as the identifier of your system and helps other users to connect using it over a network. 
You can view the “Hostname” using the “hostname” and “echo %COMPUTERNAME%” commands as well. Additionally, you can change your computer system’s hostname using the “Rename-Computer” cmdlet. This guide has shed light on the “hostname Command in Windows”.