Changing Hostname

A computer hostname is used to label a particular computer, or device, which is connected to a network. It is concatenated with the network name to create the full name of the computer.

The hostname command can be used to elicit the host name part of the computer name.

On a Debian based system the hostname of a computer is stored in the file /etc/hostname. You may also need to edit the name configured in the file /etc/hosts.

Example of content from /etc/hosts file:

127.0.0.1       localhost
127.0.0.1       apple.vntweb.co.uk        apple
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Once the new hostname has been configured the change can be permanently implemented by running /etc/init.d/hostname.sh start.