Configuring hostname and hostname resolutions (DNS)
Remembering IP addresses, whether they are IPv4 or IPv6 addresses, can become a nightmare. To make things easier, a more human approach was used for the hostnames and the DNS, in that we can translate those easier-to-remember names into the IP addresses that systems use for connecting.
Hostnames are the names we assign to a host to have them identified, but when they're used in addition to a DNS server, we must have other hosts that can resolve them into IP addresses they can connect to.
We can use the hostname
command to see or to temporarily modify the current hostname, as shown in the following screenshot:
Bear in mind that this change is only temporary; as long as we restart the server, it will use the configured one.
To define a new configured hostname, we will use the hostnamectl set-hostname
command, as shown in the following...