[pappy@chmodx]:$ man hostname

$ hostname

Show or set the system hostname

DOCUMENTEDSystem informationUbuntu 24.04 LTS baseline

Synopsis

hostname [OPTION]... [NAME]

What it does

Examples

Show the current hostname
hostname
Show the hostname from DNS if configured
hostname -f

Important details

These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration. For exact option semantics, the linked authoritative documentation is the source of truth.