How to change the hostname for your Ubuntu machine?

To answer this question, first I need to know what is my hostname?  Type the command “hostname –fqd”, it will tell you.

To temporarily change it, “hostname {your name}”;

if you want to make this change permanent, you need more. First change the content of the file “/etc/hostname” to your host name, then “/etc/init.d/hostname.sh start”.

Note that you may need super user permissions.

Another way is use the “sysctl” command: “sysctl kernel.hostname={your name}”, not sure the detail use, check “man sysctl”.