Friday, August 17, 2012

Ubuntu: change the hostname

I was making a small cluster for testing based on several ubuntu VM's.

I just installed the minimal ubuntu host, configured it and the copied several times. After that I needed to change the hostnames on those ubuntu hosts, to distinguish them somehow :)

First of all the current name of the host:
sysctl kernel.hostname

To change it
sysctl kernel.hostname=NewHostname

Doesn't work for me (you may try if it works for you)
cat "new-host-name" > /etc/hostname