RHCSA RHEL 8 – Configure hostname resolution

Your support on Ko-Fi is much appreciated:

👉 https://ko-fi.com/csg_yt

Recommended RHCSA book:

📔 Amazon AU: https://amzn.to/2X5FL98

Buy CSG Merchandise:

👉 http://tee.pub/lic/csg

More information on Sophos Home Antivirus:

👉 http://bit.ly/SophosHP

More information about Hostinger VPS:

👉 http://bit.ly/H-VPS

Join our new discord channel:

👉 https://discord.gg/kBQ6Jry

This video is based on RHEL 8. Video to cover the section ‘Configure hostname resolution’ for the RHCSA (Red Hat Certified System Administrator).

More information on the required learning: http://bit.ly/rhcsa8

Notes from the video:

Hostnames

All machines in a network have in addition to an IP address, a hostname. The hostname is literally a name for the host.

To view the current hostname in short format:

# hostname -s

The view the fully qualified domain name (FQDN):

# hostname -f

To change the hostname edit the following file:

# vi /etc/hostname

To then force the update of the hostname run:

# hostnamectl

DNS

DNS or Domain Name Servers are special servers that provide resolution of a FQDN to an IP address. This allows to have the added benefit of not having to type in the IP address every time you want to connect to a network device.

To see the current configured DNS servers you can check the following file:

# cat /etc/resolv.conf

To add/update the DNS servers on an interface (this example eth0) run the following:

# nmcli con mod eth0 ipv4.dns "8.8.8.8 8.8.4.4"

To then force the read of this for configuration for DNS resolution run:

# nmcli con reload

# systemctl restart NetworkManager

To manually overwride what is configured on the DNS server with a local configuration you can edit the following file which acts as a local DNS server.

# vi /etc/hosts

An example entry would be:

172.28.18.3 RHEL8.local RHEL8

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started