Open the file
/etc/sysconfig/network using your favorite editor, auted as root or using sudo. We'll use nano for this example.
[root@daddylinux~]#
nano -w /etc/sysconfig/networkThe file will contain something along the lines of this:
NETWORKING="yes"
GATEWAY="10.0.0.1"
HOSTNAME="www.example.com"In order to change the hostname, you need to edit the
HOSTNAME value. For an example if you wanted your hostname to be server1.example.com you would set it to:NETWORKING="yes"
GATEWAY="10.0.0.1"
HOSTNAME="server1.example.com"Once you have set the desired hostname, save the changes and close the editor. If you used nano, this is done by pressing CTRL+x and then Enter to write/save the modified file. The new hostname will not be applied until your next reboot.
If you would like to temporarily apply the new hostname (until the next reboot), you can use the hostname command:
[root@daddylinux~]#
hostname server1.example.comIn order to verify the new hostname, simply issue the command on it's own:
[root@daddylinux~]#
hostname
server1.example.comIn order for your new hostname to resolve properly, you should also update your
/etc/hosts file to reflect the change. For an example:127.0.0.1 server1.example.com localhost localhost.localdomainsource : centosforge.com
how can i change a relayhost password on centos?
ReplyDeleteHave been manually changing my hostname after every reboot because I did not know how to change it permanently - until now - Thank you!
ReplyDeleteIn CentOS 7 use the command hostnamectl
ReplyDeletehttps://der-linux-admin.de/2014/10/centos-7-hostnamen-aendern/
I absolutely loved how you have created your website, it's simple, neat, simple to navigate and extremely easy on the eyes. Is it possible to let me know which theme or designer did you use.
ReplyDeletecpanel
check my source
ReplyDeletecheck that
you can look here
about his
Learn More Here
linked here
site here
Web Site
click for info
visit this page
This guide provides a clear and concise explanation of how to modify hostname settings in CentOS.
ReplyDelete