Setting Hostname From Network Manager TUI
Step 1: Check the Current Hostname
First, you need to check the current hostname of the device by using the hostname command in terminal
hostname
Step 2: Set the Hostname
Set the hostname using Network Manager TUI with the ânmcli general hostname <new_name>â command in the terminal, and replace â<new_name>â with your desired new hostname. Here we are setting our new hostname to w3wiki from GFG.
nmcli general hostname w3wiki
Step 3: Privilege Access
After running the previous step, it will prompt for administrator access. Provide the necessary permission by authenticating with your machineâs password.
Step 4: Restart NetworkManager
After setting the hostname, restart NetworkManager using âsudo systemctl restart NetworkManagerâ and restart your machine to apply the changes permanently.
sudo systemctl restart NetworkManager
Step 5: Verification
You can verify the changes using the hostname command in the terminal:
hostname
How to Set Hostname Permanently in Linux
Setting a hostname is a fundamental step in configuring a Linux system. The hostname acts as an identifier for your machine on a network, making it easier to manage and communicate with other devices. In this article, weâll explore the importance of having a well-defined hostname and the process of setting it permanently in a Linux environment.
A hostname not only gives the recognition of your system but also has a crucial role in networking. Whether youâre on a local network or the internet, you should have a clear and identifiable hostname for the administration of your Linux machine.
You can set a temporary hostname using the hostname command while a permanent hostname configuration stays the same even after reboots. This article lets you know how to configure a permanent hostname, understand the relevant configuration files, and the necessary steps to apply the changes.