HOSTNAME=<value>, where <value> should be the Fully Qualified Domain
Name (FQDN), such as hostname.example.com, but can be whatever
hostname is necessary.
Setup prompts you to supply a host name for this computer, either as a fully-qualified domain name (FQDN) in the format hostname.domainname
or as a short host name in the format hostname.
The kernel maintains the system hostname. The init script in runlevel
S which is symlinked to “/etc/init.d/hostname.sh” sets the system
hostname at boot time (using the hostname command) to the name stored
in “/etc/hostname”. This file should contain only the system hostname,
not a fully qualified domain name.
I haven’t seen any specific recommendations from IBM about which to use, but some software seems to have a preference.
My questions:
In a heterogeneous environment, is it better to use the vendor recommendation, or choose one and be consistent across all hosts?
What software have you encountered which is sensitive to whether the hostname is set to the FQDN or short name?
I would choose a consistent approach across the entire environment. Both solutions work fine and will remain compatible with most applications. There is a difference in manageability, though.
I go with the short name as the HOSTNAME setting, and set the FQDN as the first column in /etc/hosts for the server’s IP, followed by the short name.
I have not encountered many software packages that enforce or display a preference between the two. I find the short name to be cleaner for some applications, specifically logging. Maybe I’ve been unlucky in seeing internal domains like server.northside.chicago.rizzomanufacturing.com. Who wants to see that in the logs or a shell prompt?
Sometimes, I’m involved in company acquisitions or restructuring where internal domains and/or subdomains change. I like using the short hostname in these cases because logging, kickstarts, printing, systems monitoring, etc. do not need full reconfiguration to account for the new domain names.
A typical RHEL/CentOS server setup for a server named “rizzo” with internal domain “ifp.com”, would look like: