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:

[email protected]:~# 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
[email protected]:~# hostname --short
[email protected]:~# hostname --domain
[email protected]:~# hostname --fqdn
[email protected]:~# hostname --ip-address
  • en/jessie/config/network/hostname.txt
  • Última modificação em: 2020-08-02 20:10
  • (edição externa)