Bug 2152865

Summary: Clarify hostname recommendation
Product: Red Hat Enterprise Linux 9 Reporter: Marko Myllynen <myllynen>
Component: DocumentationAssignee: Sagar Dubewar <sdubewar>
Documentation sub component: default QA Contact: RHEL DPM <rhel-docs>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: medium    
Priority: medium CC: jstodola, rhel-docs, tcapek
Version: 9.1Keywords: Documentation, Reopened
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-20 11:06:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marko Myllynen 2022-12-13 10:36:23 UTC
Document URL: 
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_a_standard_rhel_9_installation/assembly_customizing-your-installation_installing-rhel#proc_configuring-network-and-host-name_network-hostname

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_an_advanced_rhel_9_installation/kickstart-commands-and-options-reference_installing-rhel-as-an-experienced-user#network_kickstart-commands-for-network-configuration

Section Number and Name: 
4.1.3.4.1. Configuring network and host name

B.4.1. network (optional)

Describe the issue: 
The latter document states that FQDN should "always" be used if not using DHCP but provides no rationale for this guideline. Some major software products like SAP are known to require short name to be used in /etc/hostname so using FQDN "always" is not always possible. But provisioning some Red Hat components such as RH IdM will update /etc/hostname to contain FQDN if short name was used earlier.

Suggestions for improvement: 
There is no one right or wrong answer whether /etc/hostname should contain short name or FQDN. However, we should ensure our documentation is consistent and in this particular case perhaps explain that the right answer depends on the situation.

I think the note in the first documented could be adjusted slightly (my proposal below) and the copied to the second document.

-----

The host name can be either a fully-qualified domain name (FQDN) in the format hostname.domainname, or a short host name with no domain name.

Many networks have a Dynamic Host Configuration Protocol (DHCP) service that automatically supplies connected systems with a domain name. To allow the DHCP service to assign the domain name to this machine, specify only the short host name.

When using static IP and host name configuration it depends on the planned system use case whether short name or FQDN should be used. Red Hat Identity Management configures FQDN during provisioning but some 3rd party software products may require short name to be used. In either case it is probably a good idea to add an entry for the host in /etc/hosts in the format "IP  FQDN short-alias" to ensure availability of both forms in all situations.

The value localhost means that no specific static host name for the target system is configured, and the actual host name of the installed system is configured during the processing of the network configuration, for example, by NetworkManager using DHCP or DNS.

Host names can only contain alpha-numeric characters and - or .. Host names cannot start or end with - and .. In order to be compliant with DNS, each component of a FQDN should be no longer than 63 characters and the FQDN total length, including dots, should not exceed 255 characters.