Computer Name in Windows operating systems are used to name the computer or system uniquely. Even if regular users do not aware of the computer name, it is very important in enterprise environments or multiple system networks. The computer name can be also called as to
Host Name where this computer or hostname is used for different network protocols like DHCP, and SMB to name a computer uniquely. The computer name identifies the computer from other computers. By default, the Windows operating system sets the computer name by using random characters in order to prevent name collision or set the same name for multiple computers. The name will be like RHF2D-N3N which is meaningless and hard to remember. You can find your computer name in different ways like using the
System menu or MS-DOS command line or PowerShell command line. The computer name is also used with the domain name where the domain is used to group and manage multiple systems under a single authority with a name. A computer name is used to differentiate the current system from the other systems.
Display Computer Name From System
The computer name can be displayed by using the
System screen or menu which can be opened in different ways. For Windows 7, Windows 8, Windows 10 or Windows Server versions use the Start Menu and type
System which will list the System screen shortcut like below.
Alternatively, you can access the system screen by using the control panel which lists the
System shortcut. We can see the System screen which displays the
Computer name under the
Computer name, domain, and workgroup settings . The full computer name is the computer name with the domain name but as this system is not joined a domain the Full computer name is the same as the computer name. We can also see that the computer starts with the
DESKTOP and contains random characters.
Display Computer Name From MS-DOS Command Line
The MS-DOS windows command line provides the
hostname command which is purposefully created to print the current system hostname which is the same as the computer name. We will just type the hostname command to the MS-DOS.
C:\> hostname DESKTOP-HQVAMA3
Display Computer Name From PowerShell Command Line
PowerShell provides different methods in order to display the computer name or hostname. The computer name can be displayed by using environment variables with the
$env variable. In the following example, we will specifically print the computer name to the PowerShell command prompt.
Also, like the MS-DOS command line the
hostname command can be used for the PowerShell to print computer name without any problem.
Display Computer Name In MacOSX (Apple)
MacOSX or Apple computers also use the Computer Name in order to identify their system. Even these computer names are used to join the MacOSX system into a Microsoft Windows Active Directory. The computer name of the MacOSX can be displayed with the following steps.
- Click on the Apple Start Menu
- Click on the System Preferences
- Click on Sharing.
- The computer name will be displayed on the top of the window in the Computer Name field.
If you want to list the computer name from the command line or shell in MacOSX you can use the scutil command with the –get HostName parameter like below.
$ scutil --get HostName
Display Computer Name In Linux (Ubuntu, Mint, Kali, CentOS)
Linux distributions also use computer names which are called the hostname in Linux terminology. The Ubuntu, Mint, Kali, Debian, CentOS, and other popular distributions stores the computer name under the file located /etc/hostname which can be printed with the cat command.
$ cat /etc/hostname
Alternatively, the hostname command is provided by default which will print the computer name too.
Alternatively, the modern version of the hostname command is the
hostnamectl command which displays detailed information about the system with the hostname.
The hostname information is provided via the
Static hostname line.