I recently needed to change the name of my Linux Operating System server, it is a Debian Lenny 5.0 Stable, what I did to make the change permanently is to run this line.

sudo vim /etc/hostname

And add something like this in there:


Then I run the /etc/init.d/hostname.sh script, and that is, to test it run:

uname -n


hostname -a