Linux: changing hostname on the fly

To change hostname on a machine quickly


echo 'hostname' > /proc/sys/kernel/hostname

logout and log to see the changes.

The proc dir is a pseudo file system. To do it permanently, you need to change /etc/sysconfig/network and /etc/hosts

Like it.? Share it:

Comments are closed.