Whatever it may be, you should go with what works for you and your organization. In the grand scheme of things, you have to be convinced about the value you are getting for the money you are spending...

Home » Post Item » Easisest way of changing Linux (CentOS, Fedora, RedHat) Hostname

Easisest way of changing Linux (CentOS, Fedora, RedHat) Hostname

February 19, 2011

Use the echo command to replace the contents of /proc/sys/kernel/hostname with your new host name.

# echo hostname.com > /proc/sys/kernel/hostname

Then restart the network interfaces:

# /etc/init.d/network restart Shutting down interface venet0:  [  OK  ] Shutting down loopback interface:  [  OK  ] Bringing up loopback interface:  [  OK  ] Bringing up interface venet0: RTNETLINK answers: File exists RTNETLINK answers: File exists [  OK  ]

Now you can use the hostname command to verify that it has changed.

 Be it known that it will not touch or changed any thing in /etc/hosts use it at your own Descretion =)


Posted by linux at 12:08 pm | permalink

All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.

Add a comment