Hostname command

Updated: 11/12/2023 by Computer Hope
hostname command

The hostname command displays the hostname of the machine that is running it.

Availability

Hostname is an external command and is available for the following Microsoft operating systems as hostname.exe.

Hostname syntax

hostname [/?]

Hostname examples

hostname

Display the hostname for the computer.

hostname /?

Display a help message.