Skip to content

Linux Name Swap: The Ultimate Guide to Changing Your Hostname Revealed!


The best technique to change your hostname in Linux

Linux prospects often use technical jargon related to the kernel occasion. One such time interval is hostname, which refers back to the title of your PC. In case you’re new to Linux, altering the hostname may appear troublesome. Nonetheless, on this data, we are going to make clear easy strategies to vary hostname in Linux.

The best approach to take a look at your hostname in Linux

You can merely search for your hostname in Linux utilizing a few easy directions. First, open the Terminal and order the following command:


An alternative choice to look at your hostname is thru using the cat command. The hostname is saved contained in the hostname textual content material file, which might be found contained in the checklist / and so forth. To look at the hostname utilizing this system, open the Linux terminal and concern the following command:

cat /and so forth/hostname

You may also assessment your hostname by accessing the Settings app, deciding on About, then Gadget Identification.

The Proper Option to Change Your Hostname in Linux (3 Strategies)

There are three completely totally different methods it is best to use to vary your hostname in Linux. We uncover every method within the underwear.

1. Change the hostname utilizing the terminal

One choice to vary the hostname is to edit the hostname file throughout the / checklist and so forth. Listed below are the steps to do it:

  1. Open the terminal and enter the following command:
sudo nano /and so forth/hostname
  1. Edit the foundation line of the file and enter the brand new hostname.
  1. Press Ctrl+O to keep away from losing the file, then press Enter to confirm the file title and eventually press Ctrl+X to exit the file.
  2. Right here you’re! You’ve gotten effectively modified the hostname of your Linux PC utilizing the terminal.

2. Change the hostname throughout the Settings app

When you’re utilizing a Linux distribution with a desktop really feel like GNOME or KDE, you’ll be able to change the hostname straight away from the Settings app. That is how:

  1. Go to Settings, then click on About.
  2. Select the textual content content material object of the Determine gadget and enter the brand new hostname.
  3. Click on the examination icon to keep away from losing changes.

3. Utilizing the Hostnamectl command

The Hostnamectl command lets you show or change the values ​​related together with your Linux desktop data, together with the hostname. To vary the hostname utilizing this command, observe these steps:

  1. Kind the following command:
hostnamectl set-hostname New Hostname

By following these methods, you’ll be able to merely change the hostname in Linux and customise it in response to your preferences.


To entry extra data, kindly seek advice from the next link