To view the current hostname, enter the following command:

$ hostnamectl

1. Change the hostname using hostnamectl

$ sudo hostnamectl set-hostname linuxize

2. Edit the /etc/hosts file localhost linuxize 
# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters

3. Edit the cloud.cfg file

Search for preserve_hostname and change the value from false to true:

# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true
Categorie: Development

0 commenti

Lascia un commento

Segnaposto per l'avatar