Microsoft DOS hostname command

Updated: 11/10/2017 by Computer Hope

About hostname

Display the hostname of the machine the command is being run on.

Availability

The hostname command is an external command and is available in the below Microsoft operating systems as hostname.exe.

Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8
Windows 10

Hostname syntax

hostname

sethostname: Use the Network Control Panel Applet to set hostname.

Note: hostname -s is not supported.

Hostname examples

hostname

Running the command would display the hostname for the computer.

Additional information

  • See our hostname definition for further information and related links on this term.