Usually this is an easy task using the
hostnamecommand:
[root@blah ~]# hostname
blah
[root@blah ~]# hostname florian
[root@blah ~]# hostname
florian
But on some distributions, this procedure is not modifying the hostname permanently.
On Debian based systems you must:
1. edit /etc/hostname and put there whatever hostname you want to set;
2. run
/etc/init.d/hostname.sh start
on RedHat based systems you have to:
1. edit
/etc/sysconfig/network and put on HOSTNAME stanza whatever you want.
2. Reboot.
You can modify the hostname also via sysctl command:
to read:
sysctl kernel.hostnameto modify:
sysctl kernel.hostname=blah- Log in to post comments
- 21011 views