2.1.3 Hostname

After the instalaltion, the hostname can be changed.

The system name or hostname is stored in the configuration file /etc/hostname. This file shall contain only the hostname, not the fully qualified domain name. To permanently change the name of the system, just edit the file:


Now, we need to activate the new name:

root@server:~# hostname -F /etc/hostname

Then, the new name must be associated with the IP address and the fully qualified domain name of our system. This associations ae stor4d in the configuration file /etc/hosts:

/etc/hosts       localhost   server.home.lan server

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@server:~# hostname --short
root@server:~# hostname --domain
root@server:~# hostname --fqdn
root@server:~# hostname --ip-address
  • en/jessie/config/network/hostname.txt
  • Última modificação em: 2022-04-07 14:49
  • por