Quickly view and change a Linux machine identity with a single systemd tool. 23.03.2026 | reading time: 2 min Who is this machine on the network? Use `hostnamectl` to answer and to change that identity cleanly; it queries systemd-hostnamed, shows kernel and virtualization info, and sets static, pretty, or transient hostnames with one tool. Quick demo Try this simple session as root or with sudo to inspect and change a hostname: ```bash $ sudo hostnamectl status Static hostname: web01.example.com Icon name: computer-server Chassis: server Machine ID: 0123456789abcdef0123456789abcdef Boot ID: fedcba9876543210fedcba9876543210 Operating System: ExampleOS 8.4 Kernel: Linux 5.15.0-27-generic Architecture: x86-64 $ sudo hostnamectl set-hostname web02.example.com --static $ hostnamectl status Static hostname: web02.example.com ... ``` Practical knobs you will use Set names by intent: `--static` writes `/etc/hostname` and survives reboots, `--pretty` sets a human-friendly name that may contain spaces and emoji, and `--transient` only lasts until the next reboot or until NetworkManager/cloud-init override; use `hostnamectl set-hostname NAME --pretty` to give a descriptive label while keeping a short static name for DNS. Interoperability notes Remember that other services can override hostnames: NetworkManager, cloud-init or orchestration tools may set a transient or static name; editing `/etc/hostname` directly is also effective but less atomic; administrative privileges are required to change names, and checking `hostnamectl status` helps diagnose mismatches between DNS, /etc/hosts and systemd-hostnamed. Where this leads Hostname management is small but central: consistent names ease monitoring, logging and automation; master `hostnamectl` and you remove a frequent source of confusion in deployments and troubleshooting, then level up toward certification study and hands-on exams. Join Bits & Bytes Academy First class LINUX exam preparation. setup network utilities boot-process infrastructure