Hosts get registered as localhost.localdomain on Red Hat Satellite 6.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6, 7
  • Red Hat Satellite 6

Issue

When registering a new system with Red Hat Satellite 6 and after installing katello-agent, the system is not reflected in the Red Hat Satellite using the configured hostname.

  • On the Red Hat Satellite cli:
434 | localhost.localdomain                                     | RedHat 6.7       |            | 192.168.0.1     | aa:bb:cc:dd:ee | RHEL6        | Produccion

Resolution

  • The system must be unregistered, eliminate Katello-facts and re-register the Host:
# subscription-manager unregister
# yum clean all
# cd /etc/rhsm/facts/
# rm -r katello.facts

# katello-rhsm-consumer
# subscription-manager register --org="default-name" --activationkey="default-ak"
  • Verify in the Satellite if the host is found with its correct name with the following commands:
[root@host]# subscription-manager facts

network.fqdn: host.example.net
network.hostname: host
network.hostname-override: host
network.ipv4_address: 192.168.0.1

[root@satellite]# hammer host list
----|-----------------------------------------------------------|------------------|------------|-----------------|-------------------|--------------|----------------------
ID  | NAME                                                      | OPERATING SYSTEM | HOST GROUP | IP              | MAC               | CONTENT VIEW | LIFECYCLE ENVIRONMENT
----|-----------------------------------------------------------|------------------|------------|-----------------|-------------------|--------------|----------------------
193 | host                                                | RedHat 6.7       |            |192.168.0.1     |aa:bb:cc:dd:ee |  RHEL6        | Produccion
  • Also, check the correctness of the /etc/hosts on the host:
127.0.0.1   localhost.localdomain   localhost   client_name

Note - Remove the client_name in the above line.

Root Cause

  • When creating a new system and installing katello-agent without first modifying the hostname of the server, a record is created in /etc/rhsm/facts/katello.facts with the name:
{"network.hostname-override":"localhost.localdomain"}

and when searching within the Satellite using the WebUI or hammer host list, the IP and MAC address of the system is displayed, but not the same with its name:

  • On Host,
network.fqdn: host.example.net
network.hostname: host
network.hostname-override: localhost.localdomain
network.ipv4_address: 192.168.0.1
  • On Satellite,
434 | localhost.localdomain                                     | RedHat 6.7   |         |  192.168.0.1     | aa:bb:cc:dd:ee |  RHEL6        | Produccion
  • Incorrect entry in /etc/hosts of the client:
127.0.0.1   localhost.localdomain   localhost   client_name  
10.x.x.1    satellite.example.com
  • Incorrect entry of client_name.

Diagnostic Steps

  • Check the configuration inside /etc/hosts to confirm that the IP, route, and name are correct:
127.0.0.1   localhost.localdomain   localhost.localdomain   localhost4  localhost4.localdomain4 localhost   
::1 localhost.localdomain   localhost.localdomain   localhost6  localhost6.localdomain6 localhost   
192.168.0.1 host.example.net host

Then on the host run # subscription-manager facts and check the output:

network.fqdn: host.example.net
network.hostname: host
network.hostname-override: localhost.localdomain        <--- `Here should be the correct name of the server and not localhost`
network.ipv4_address: 192.168.0.1
  • Check the hostname on the Red Hat Satellite:
# hammer host list
----|-----------------------------------------------------------|------------------|------------|-----------------|-------------------|--------------|----------------------
ID  | NAME                                                      | OPERATING SYSTEM | HOST GROUP | IP              | MAC               | CONTENT VIEW | LIFECYCLE ENVIRONMENT
----|-----------------------------------------------------------|------------------|------------|-----------------|-------------------|--------------|----------------------
434 | localhost.localdomain                                     | RedHat 6.7       |            |192.168.0.1     | aa:bb:cc:dd:ee| RHEL6        | Produccion

Query usingdig

[root@satellite ~]# dig *host* @192.168.0.1  ** In this query the alias is consulted (hostname only) **

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> *host* @192.168.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5177
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4000
;; QUESTION SECTION:
;host.                    IN      A    <========= This does not return any IP.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.