[ad_1]
The right way to Change Your Hostname in Linux
Linux customers usually use technical jargon associated to the event of the kernel. One such time period is “hostname,” which refers back to the title of your PC. In case you are new to Linux, altering the hostname could appear difficult. Nevertheless, on this information, we are going to clarify easy methods to change the hostname in Linux.
The right way to Examine Your Hostname in Linux
You’ll be able to simply examine your hostname in Linux utilizing a couple of easy instructions. First, open the Terminal and sort the next command:
hostname
One other option to examine your hostname is through the use of the cat command. The hostname is saved within the hostname textual content file, which will be discovered within the /and so forth listing. To examine the hostname utilizing this technique, open the Linux Terminal and sort the next command:
cat /and so forth/hostname
You may as well examine your hostname by going to the Settings app, deciding on About, after which Gadget Identify.
The right way to Change Your Hostname in Linux (3 Methods)
There are three totally different strategies you should utilize to alter your hostname in Linux. Let’s discover every technique intimately.
1. Change Hostname utilizing Terminal
One option to change your hostname is by modifying the hostname file within the /and so forth listing. Listed here are the steps to do it:
- Open the terminal and enter the next command:
sudo nano /and so forth/hostname
- Edit the primary line of the file and enter the brand new hostname.
![Change hostname in terminal](https://beebom.com/wp-content/uploads/2023/06/Change-hostname-in-terminal-e1686732183663.png?w=618)
- Press Ctrl+O to avoid wasting the file, then press Enter to verify the file title, and eventually press Ctrl+X to exit the file.
- Voila! You have got efficiently modified the hostname of your Linux PC utilizing the Terminal.
2. Change the Hostname within the Settings app
In case you are utilizing a Linux distribution with a desktop atmosphere like GNOME or KDE, you may change the hostname instantly from the Settings app. This is how:
- Go to Settings, then click on on About.
- Choose the Gadget Identify textual content subject and enter the brand new hostname.
- Click on the examine icon to avoid wasting the adjustments.
3. Utilizing Hostnamectl Command
The Hostnamectl command permits you to show or change the values associated to your Linux desktop’s info, together with the hostname. To alter the hostname utilizing this command, observe these steps:
- Kind the next command:
hostnamectl set-hostname "New Hostname"
![Hostnamectl command to change the hostname](https://beebom.com/wp-content/uploads/2023/06/Hostnamectl-command-to-change-the-hostname-e1686735572961.png?w=640)
By following these strategies, you may simply change the hostname in Linux and customise it in response to your preferences.
[ad_2]
For extra info, please refer this link