Lab 19: Configure Hostname
Objective Focus
Manage basic networking :Configure hostname resolution
Official RHCSA EX200 Exam Objectives
Get the hostname of the system
$ hostname
- Please note that using the hostname command to change the hostname will not survive a reboot.
Change the hostname of the system
$ hostnamectl set-hostname <newname>
- If you are not root, sudo will be required
$ nmtui
- nmtui can also be used to change the hostname. I prefer this method!
Important hostname related files
$ /etc/hostname
- Local hostname configuration file
$ /etc/hosts
- Static table lookup for hostnames
$ /etc/resolv.conf
- Resolver configuration file
Why Hostname is important
IPv4 and IPv6 addresses are really difficult for us, humans, to remember. So, we assign hostnames to computers like a name tag. It is like when we save a phone number and we add a name to the contact info.
That is it for this lab, understanding hostnames will help us tremendously in the field. And it is used in combination with a lot of other commands.