-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux hostnamectl Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to hostnamectl on Linux, covering Arch Linux, CachyOS, and other distributions including hostname management, system identification, and systemd hostname control.
hostnamectl controls system hostname (systemd).
Uses:
- Set hostname: Change system hostname
- View hostname: Show hostname information
- System identification: Identify system
- Persistent changes: Changes persist across reboots
Why it matters:
- Modern tool: systemd-based tool
- Persistent: Changes are permanent
- System management: Manage system identity
Basic usage:
# View hostname information
hostnamectl
# Shows hostname detailsGet hostname:
# Current hostname
hostnamectl status
# Shows hostname statusChange hostname:
# Set hostname
sudo hostnamectl set-hostname new-hostname
# Changes hostname permanentlySet static:
# Set static hostname
sudo hostnamectl set-hostname --static new-hostname
# --static = static hostnameComplete info:
# All hostname information
hostnamectl
# Shows:
# - Static hostname
# - Pretty hostname
# - Icon name
# - Chassis
# - Machine IDSet pretty name:
# Set pretty hostname
sudo hostnamectl set-hostname --pretty "My Computer"
# --pretty = human-readable nameCheck systemd:
# hostnamectl is part of systemd
# Usually pre-installed on systemd systems
# Check systemd
systemctl --versionThis guide covered hostnamectl usage, hostname management, and system identification for Arch Linux, CachyOS, and other distributions.
- hostname Guide - Legacy hostname tool
- System Configuration - System setup
-
hostnamectl Documentation:
man hostnamectl
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.