Scroll to navigation

HOSTNAME(1) General Commands Manual HOSTNAME(1)

NAME

hostname - Display or set the system's host name.

SYNOPSIS

hostname [-d|--domain] [-i|--ip-address] [-f|--fqdn] [-s|--short] [-h|--help] [-V|--version] [host]

DESCRIPTION

Display or set the system's host name.

OPTIONS

Display the name of the DNS domain if possible
Display the network address(es) of the host
Display the FQDN (Fully Qualified Domain Name) (default)
Display the short hostname (the portion before the first dot) if possible
Print help
Print version
[host]

VERSION

v(uutils coreutils) 0.9.0

EXAMPLES

Show current host name:

hostname

Show the network address of the host name:

hostname [-i|--ip-address]

Show the FQDN (Fully Qualified Domain Name):

hostname [-f|--fqdn]

Set current host name:

hostname new_hostname

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

2026-06-04