Change Linux host name permanently through command line
If you are trying to change Linux host name permanently through command line using shell terminal and its not changing using host name command, I am sure this will definitely help you to solve your problem. Here we can see simple steps to permanently change host name (Computer Name) of your Linux server desktop which will not be change after restarting.
Steps to change host name :-
Use any one of your favorite available editor such as vi, vim, gedit, nano, pico and openvi /etc/sysctl.conf file.
And add the following lines in sysctl.conf.
kernel.hostname = techitadmin (your desire host name)
kernel.domainname = techitadmin.com (your domain name)
After adding the above entry run this command # sysctl -p /etc/sysctl.conf
Problem solved,
Now just type “hostname” and press enter.
# hostname command will show now new changed host name.


0 Comments:
Post a Comment