Change Linux host name permanently through command line

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