Node and Host Name Sizes on HP-UX: Using the Expanded Capabilities of HP-UX

4
Activating and Setting Expanded Node and Host Names
This section describes how to activate the capability to set longer node and host names, and how to
actually set the longer names.
Note the following important considerations:
You must verify that the versions of all applications that use node or host names are validated
for expanded node and host name sizes before setting the names to longer values.
When longer node or host names are assigned, it is recommended that proper operation of
all applications be validated in a test environment before use in a production environment.
Some HP products are limited in their support of long node or host names (see HP Product
Limitations).
Third-party software products might be limited in their support of long node names or host
names. Consult the associated documentation for products to ensure that they do support
expanded names.
Locally developed programs (for example, from an in-house software development
organization) might offer limited support of long node or host names.
The behavior of the nonexpanded version of the uname(2) system function when the system
node name is set to a value greater than 9 bytes (including null terminator) is configurable. It
can be configured to return the EOVERFLOW error, which alerts the program that the data
cannot be returned (this is the default). Any program using the nonexpanded version will
likely abort, unless it is ignoring errors.
The system can be configured to return truncated data rather than an error from the non-
expanded uname(2) system function. Such truncated data might allow the program to
continue with no visible abnormal behaviors. On the other hand the program might provide
ambiguous outputs or behave in some indeterminate manner. Programs updated to use the
expanded version do not exhibit these problems.
Any program that uses the gethostname(2) system function and that is not enhanced to
accommodate the expanded node and host name sizes, receives a truncated host name from
this interface. The value is truncated to the size of the program buffer, which is typically 64
bytes in non-enhanced programs. If the program is written to detect truncation, it might abort
on systems where the host name is set to a value longer than 64 bytes. For other programs,
undetected truncation might result in ambiguous output or indeterminate program behavior.
Any program that uses the utsname structure definition and that is not enhanced to
accommodate the expanded structure version might exhibit ambiguous output or other
indeterminate behavior.
Any program that internally uses the symbolic constantsSYS_NMLN, SNLEN, UTSLEN, or
MAXHOSTNAMELEN can have issues similar to those described in the preceding paragraphs.
For complete information about application issues, see the programmer-oriented sections and
appendixes of this document.
Activating Expanded Node and Host Names
The default operating system configuration does not allow you to set a node name to greater than 8
bytes, or a host name to greater than 64 bytes. A dynamic kernel tunable parameter,
expanded_node_host_names, must be turned on to allow larger names to be set. It is
documented in the manpage expanded_node_host_names(5). To turn on this parameter, use
the following command: