Ubuntu 18.04 change hostname
1. Change the hostname using hostnamectl.
In Ubuntu 18.04 we can change the system hostname and related settings using the command hostnamectl.
For example is we want to change the system static hostname to linuxize, we can use the following command:
sudo hostnamectl set-hostname linuxize
2. Edit the /etc/hosts file.Open the /etc/hosts file and change the old hostname to the new one.
127.0.0.1 localhost
127.0.0.1 linuxize
3. Edit the cloud.cfg file.
If the cloud-init package is installed you also need to edit the cloud.cfg file. This package is usually installed by default in the images provided by the cloud providers such as AWS and it is used to handle the initialization of the cloud instances.
To check if the package is installed run the following ls command:
ls -l /etc/cloud/cloud.cfg
In this case you’ll need to open the /etc/cloud/cloud.cfg file:
sudo nano /etc/cloud/cloud.cfg
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
Updatable objects appear as 'no longer supported'
Symptoms In some scenarios, the following validation warning appears on an updatable object: " Object is no longer supported. Enforci...
Mais vistos
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...
-
Kaspersky seems to be storing windows update files on the C Drive: Here -> C:\ProgramData\KasperskyLab\adminkit\1093\.working Change fo...
-
This particular error is generally experienced when people attempt a non NTFS volume such as ReFS to a DFSR replication group as documented...