What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
On a standard Ubuntu installation, run hostnamectl to see the system’s hostname and sudo hostnamectl set-hostname web-node-1 to change it. Replace web-node-1 with your chosen name, then run hostnamectl again to verify. The change normally persists across reboots on a conventional local system; cloud instances may be configured to replace it.
Find the current hostname
Open a terminal and run:
hostnamectl
The status output shows hostname information, including the static, transient, and pretty names when available. To print the hostname currently active in the kernel, run:
As an Amazon Associate I earn from qualifying purchases.
hostname
To display one specific systemd hostname type, use hostnamectl --static, hostnamectl --transient, or hostnamectl --pretty. The hostnamectl command with no subcommand displays status. These options are documented in the Ubuntu Noble hostnamectl manual.
Change the hostname
-
Choose a simple name, such as
web-node-1. Lowercase ASCII letters, digits, and hyphens are a safe choice; avoid spaces for a standard machine name. -
Set the name with administrator privileges:
sudo hostnamectl set-hostname web-node-1Replace the example with your chosen name. On modern Ubuntu, this default command changes the pretty, static, and transient hostname values together. Use
--static,--transient, or--prettywithset-hostnamewhen you specifically want to change only one type. -
Verify the result:
hostnamectlYou can also run
hostnameto check the active kernel hostname.
Ubuntu’s Noble manual documents these commands for systemd 255.4-1ubuntu8.17. Jammy-era documentation describes the same general hostname-type behavior; on unusually customized or older installations, consult the local hostnamectl manual for supported options.
Choose a valid system hostname
Systemd distinguishes three hostname types:
-
Static: The configured system name, normally stored in
/etc/hostnameand applied at boot. -
Transient: A runtime name that may be supplied by network configuration, such as DHCP. It is used when a static hostname is not configured.
-
Pretty: A presentation-friendly UTF-8 name that can include spaces and other characters.
Rank #4
Static and transient hostnames follow DNS-style naming rules and are limited to 64 characters. A single label such as web-node-1 is a straightforward choice for the system hostname; dots can be used when configuring a valid fully qualified domain name. The Ubuntu hostname configuration manual recommends a single label in /etc/hostname.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →When the default hostnamectl set-hostname command sets multiple types, systemd simplifies the value for static and transient use by removing characters those types do not allow. Entering a DNS-compatible name avoids surprises from that cleanup.
Best Value
Will the hostname change survive a reboot?
On a conventional Ubuntu installation, hostnamectl set-hostname updates the static hostname kept in /etc/hostname; systemd applies that configured name at boot. A transient name can instead come from network configuration when no static hostname is set. The change will ordinarily remain after reboot unless a higher-priority provisioning or network configuration overrides it.
If the name changes back, first determine whether the machine is managed by cloud-init or another provider-specific setup. Cloud-init’s preserve_hostname setting controls whether it changes the hostname, and its configuration can also rewrite /etc/hosts at boot. See the cloud-init module reference and check the instance’s provisioning configuration.
Google Compute Engine exception
On Google Compute Engine images using Ubuntu 24.04 LTS or later, Ubuntu documents a specific exception: /etc/hostname is absent by default and cloud-init’s create_hostname_file key is false. In this setup, setting the name through the hostname command can change it only temporarily, and Google DHCP may overwrite it. Use the cloud-init or provider mechanism appropriate to the instance, then verify the result after reboot. This behavior is specific to the documented GCE images, not all Ubuntu 24.04 systems. See Ubuntu’s GCE hostname guidance.
Hostname, FQDN, and /etc/hosts are different
Changing the system hostname does not by itself configure a fully qualified domain name (FQDN). An FQDN is resolver-derived and depends on name-service configuration. Results can be unsuitable on systems with multiple network interfaces or mobile network environments, as the Ubuntu hostname and FQDN manual explains.
The /etc/hosts file is a separate local mapping between IP addresses and canonical hostnames or aliases. If you need a local mapping for the new name, review existing entries before editing them, especially if services or scripts still refer to the old name. The Ubuntu hosts manual describes this file’s format.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

