How to Change Hostname on CentOS 9 Stream: A Step-by-Step Guide
If you’re managing multiple servers, hostnames can be a valuable tool for organization. In this tutorial, we’ll explain what a hostname is and provide three methods to change it on a CentOS 9 Stream machine.
What Is a Hostname?
A hostname is a unique name assigned to a computer or server. It helps distinguish different machines on a network. Hostnames can be private or public, depending on whether they are combined with a domain name.
How to Change Hostname Using Hostinger’s Control Panel
If you’re using Hostinger’s virtual machine hosting, you can easily change the server’s hostname through hPanel. Simply navigate to the Settings section, locate the Change Hostname option, and enter your desired hostname. Save the changes, and you’re done.
How to Change Hostname on CentOS 9 Stream Using Hostname and Hostnamectl Commands
To change the hostname via the command line, connect to SSH or open the terminal window. Make sure you have root user privileges. Use the hostname
or hostnamectl
command to check the current hostname. Then, execute the hostnamectl set-hostname
command to change the hostname. Verify the changes with the hostnamectl
command.
How to Change Hostname on CentOS 9 Stream by Editing the /etc/hostname File
If you prefer editing files, you can change the hostname by editing the /etc/hostname
file. Use a text editor like nano to replace the current hostname with your desired one. Save the changes and verify them with the hostnamectl
command.
Static, Transient, and Pretty Hostnames
In addition to static hostnames, you can set transient hostnames that stay active until the system reboots. Use the hostnamectl set-hostname --transient
command to set a transient hostname. There’s also an option to create a pretty hostname with UTF-8 support for improved readability. Use the hostnamectl set-hostname --pretty
command to create a pretty hostname.
Conclusion
Changing hostnames can greatly assist in managing multiple servers efficiently. In this tutorial, we’ve covered various methods to change the hostname on a CentOS 9 Stream system and explained the differences between static, transient, and pretty hostnames. We hope you found this guide helpful. If you have any questions, feel free to leave them in the comments below.
👉
Start your website with Hostinger – get fast, secure hosting here 👈
🔗 Read more from MinimaDesk:
- The Ultimate Guide to WP-Content: Access, Upload, and Hide Your WordPress Directory
- 40 Essential WordPress SEO Tips to Boost Your Website’s Rankings
- How to Add and Customize RSS Feeds in WordPress
- How Many WordPress Plugins Are Too Many? Best Practices for Performance Optimization
🎁 Download free premium WordPress tools from our Starter Tools page.