OS Manuals

/usr/bin/hostnamectl

The systemd System and Service Manager

From systemd 262.2-r1 (os), captured 2026-11-05 by running hostnamectl --help (exit 0). permalink

> hostnamectl [OPTION…] COMMAND …

Query or change system hostname.

Commands:
  [status]               Show current hostname settings
  hostname [NAME]        Get/set system hostname
  icon-name [NAME]       Get/set icon name for host
  chassis [NAME]         Get/set chassis type for host
  deployment [NAME]      Get/set deployment environment for host
  location [NAME]        Get/set location for host
  tags [TAG…]            Get/set machine tags for host

Options:
  -h --help              Show this help
     --version           Show package version
     --no-ask-password   Do not prompt for password
  -H --host=[USER@]HOST  Operate on remote host
  -M --machine=CONTAINER Operate on local container
     --transient         Only set transient hostname
     --static            Only set static hostname
     --pretty            Only set pretty hostname
     --json=FORMAT       Generate JSON output (pretty, short, or off)
  -j                     Equivalent to --json=pretty (on TTY) or --json=short (otherwise)

See the hostnamectl(1) man page for details.
Options (9)
OptionDescriptionSource
-h --helpShow this helphelp
--versionShow package versionhelp
--no-ask-passwordDo not prompt for passwordhelp
-H --host=[USER@]HOSTOperate on remote hosthelp
--transientOnly set transient hostnamehelp
--staticOnly set static hostnamehelp
--prettyOnly set pretty hostnamehelp
--json FORMATGenerate JSON output (pretty, short, or off)help
-jEquivalent to --json=pretty (on TTY) or --json=short (otherwise)help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.