Reference

hostname(1)

show or set system host name

NAME

hostname - show or set system host name

SYNOPSIS

hostname [OPTION...] [NAME]

DESCRIPTION

Show or set the system's host name.

-a, --aliases

alias names

-d, --domain

DNS domain name

-f, --fqdn, --long

DNS host name or FQDN

-F, --file=FILE

set host name or NIS domain name from FILE

-i, --ip-addresses

addresses for the host name

-s, --short

short host name

-y, --yp, --nis

NIS/YP domain name

-?, --help

give this help list

--usage

give a short usage message

-V, --version

print program version

Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.

AUTHOR

Written by Debarshi Ray.

REPORTING BUGS

Report bugs to <[email protected]>.

COPYRIGHT

Copyright © 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO

The full documentation for hostname is maintained as a Texinfo manual. If the info and hostname programs are properly installed at your site, the command

info hostname

should give you access to the complete manual.

History

--aliases since Arch Linux 2026-11-01; --ip-addresses since Arch Linux 2026-11-01; --nis since Debian 1.2 (Rex); --usage since Arch Linux 2026-11-01; --yp since Debian 1.2 (Rex); -? since Arch Linux 2026-11-01; -V since Debian 1.2 (Rex); -y since Debian 1.2 (Rex).

--alias until Debian 13 (Trixie); --all-fqdns until Debian 13 (Trixie); --all-ip-addresses until Debian 13 (Trixie); --boot until Debian 13 (Trixie); --ip-address until Debian 13 (Trixie); --verbose until Debian 7 (Wheezy); -A until Debian 13 (Trixie); -I until Debian 13 (Trixie); -b until Debian 13 (Trixie); -h until Debian 13 (Trixie); -v until Debian 7 (Wheezy).