A drop-in alternative to hostnamectl for querying and changing the system hostname and related machine metadata.
Requirements:
- Zig 0.14.0 or later
- libdbus-1 development headers (
libdbus-1-devon Debian/Ubuntu,dbus-develon Fedora)
zig buildInstall to /usr/local:
sudo zig build install --prefix /usr/localInstall with man page:
sudo zig build install man --prefix /usr/local# Show current status
althost status
# Set static and transient hostname
sudo althost set-hostname myhost
# Set only static hostname
sudo althost set-hostname --static myhost
# Set only transient hostname (kernel, no persistence)
sudo althost set-hostname --transient myhost-tmp
# Set pretty hostname
sudo althost set-hostname --pretty "My Workstation"
# Set icon name
sudo althost set-icon-name computer-laptop
# Set chassis type
sudo althost set-chassis laptop
# Set deployment environment
sudo althost set-deployment production
# Set location
sudo althost set-location "Berlin, DE"
# Show version
althost --version| Platform | Status |
|---|---|
| Linux | Full support (D-Bus + direct file fallback) |
| FreeBSD | Supported (direct file operations, no D-Bus) |
| OpenBSD | Supported (direct file operations, no D-Bus) |
GNU General Public License v3.0 or later. See the SPDX headers in each source file.