HOWTO: Changing the hostname
How to change the hostname of a computer running Sabayon Linux
During installation of Sabayon Linux you may have accepted the default hostname of "localhost", or you may have specified your own hostname (e.g. "sabayonx86", "neptune" or whatever). In either case, at some point you may want to change the current hostname, and this article explains how to do it.
1. Check the current hostname is properly configured
uname -a
hostname
hostname -f
hostname -a
hostname -d
2. Edit /etc/conf.d/hostname
Change:
HOSTNAME="localhost"
to:
HOSTNAME="acertm8215"
3. Edit /etc/hosts
Change:
127.0.0.1 localhost localhost.localdomain localhost
to:
127.0.0.1 acertm8215 localhost.localdomain localhost
4. Change the hostname stored in the kernel
To see the current hostname:
sysctl kernel.hostname
To change the current hostname:
sysctl kernel.hostname=acertm8215
5. Change netbios name in /etc/samba/smb.conf (as it defaulted to hostname "localhost")
Change:
netbios name = localhost
to:
netbios name = acertm8215
6. Change the hostname in /etc/dhcp/dhclient.conf (otherwise it will still give your old hostname to other nodes on the network to which your PC is connected):
Change:
send host-name "localhost"; supersede host-name "localhost";
to:
send host-name "acertm8215"; supersede host-name "acertm8215";
7. Reboot (or restart networking).
8. Repeat Step 1 to make sure the new hostname is set up correctly.
Article created by Fitzcarraldo on 8 January 2009.