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 these easier-to-remember names into the IP addresses that our systems use for connections.
Hostnames are the names we assign to a host to identify them, 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 temporarily modify the current hostname, as shown in the following screenshot:
Figure 6.10 – Querying and changing the hostname for our host
Bear in mind that this change is only temporary – whenever we restart the server, it will use the configured one.
To define a newly configured hostname, we will use the hostnamectl set-hostname
command, as shown in...