Tuesday, April 28, 2020

How to set hostname on your system


Dear friends, today we are going to learn 2 different ways to set hostname.
1st method
hostnamectl set-hostname server.linuxlearning.com
You can set any hostname  by using above mentioned command. Give any hostname in the place of server.linuxlearning.com as per your mind.

2nd method
By editing configuration file /etc/hostname
Edit the file by using vi /etc/hostname Then enter a hostname as server.linuxlearning.com

After saving file reboot  the system by using reboot command.

Check hostname by using hostname command.
Hostname is the command to check hostname of a system. Hostname -I is used to check the IP address of a system.


Hostname -d is used to check domain name of a system.



Hostname -f is used to check fully qualified domain name (FQDN) of a system.


We can also set the hostname by using graphical user interface(GUI) 
Use command nmtui & press enter. You will get window as shown below. Click on Set System hostname. 


Press Enter & type hostname you want to set. here we have set hostname as server.linuxlearning.com             



Thanks for reading the above article . Please feel free to send your queries on zurangchaitali13@gmail.com.

No comments:

Post a Comment

If you have any doubts. Please let me know.