CertGrid CertGrid
Hands-on Lab·Red Hat Certified System Administrator

Hostname and Name Resolution

One objective, and one tool choice that matters more than it looks: dig and host query DNS directly and ignore /etc/hosts, so they can report a failure for a name that resolves perfectly well. getent hosts uses the same path an application does.

Basic Networking Guide 50 of 67 Beginner

/etc/resolv.conf is generated by NetworkManager on RHEL. Editing it by hand works until the next connection change overwrites it. The durable setting is ipv4.dns on the connection profile.

Every command on this page runs on RHCSA-A01.
Server NameIP AddressOSRolesCPURAMHDD
RHCSA-A01192.168.0.31RHEL 10.0Practice node (graded) - spare /dev/sda2 Core4 GB50 GB + 15 GB

This guide includes

Use this for one objective where the tool choice matters more than it looks. This matters because a name can resolve for an application and not for the tool you tested with - they do not consult the same sources.

Before you start

  1. The hostname

  2. Where a name is looked up

  3. The tool that tells you the truth

  4. DNS from the connection profile

Official sources