Microsoft DOS hostname command

Updated: 05/21/2018 by Computer Hope

About hostname

Display the hostname of the machine that is running the command.


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

Hostname syntax


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

Note: hostname -s is not supported.

Hostname examples


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.