Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

uname(1)

gethostname(2)

sethostname(2)

uname(2)

hostname(5)

hostname(1)

NAME

hostname − set or print name of current host system

SYNOPSIS

hostname [name_of_host]

DESCRIPTION

hostname prints the name of the current host, as given in the gethostname(2) system call. Users who have appropriate privileges can set the hostname by giving the argument name_of_host; this is usually done in the startup script /etc/rc.  The name_of_host argument is restricted to MAXHOSTNAMELEN characters as defined in <sys/param.h>. 

The system might be known by other names if networking products are supported.  See the node manager’s documentation supplied with your system for details. 

WARNINGS

Many types of networking services are supported on HP-UX, each of which uses a different assigned system name and naming convention.  To ensure predictable system behavior, it is essential that system names (also called host names or node names) be assigned in such a manner that they do not create conflicts when the various networking facilities interact with each other. 

The system does not rely on a single system name in a specific location, partly because different services use dissimilar name formats as explained below.  System names are assigned by using the uname -S, hostname, and nodename commands.  In addition, the system name used in the HP Clustered Environment (called the cnode name) is assigned in the cluster configuration file /etc/clusterconf.  System names are assigned as follows:

Nodename Command/File Format Used By
NetIPC name nodename name foo[.a[.b]] NS Services and NetIPC
Internet name hostname name foo[.x.y.z...] ARPA and NFS Services
UUCP name uname -S name foo UUCP and related programs
cnode name /etc/clusterconf foo Cluster server and clients

where foo represents the assigned system name (it is strongly recommended that foo be identical for all commands and locations) and the optional .x.y.z or .a.b follow the specified notation for the particular ARPA/NFS or NS /Net IPC environment. 

Internet names are also frequently called hostnames or domain names (not to be confused with NFS domain names).  Refer to hostname(5) for more information about Internet naming conventions.

Whenever the system name is changed in any file or by use of any of the above commands, it should also be changed in all other locations as well.  Other files or commands in addition to those above (such as /usr/lib/uucp/Permissions if used to circumvent uname, for example) may contain or alter system names.  To ensure correct operation, they should also use the same system name. 

System names are normally assigned by the /etc/rc script at start-up, and should not be altered elsewhere. 

AUTHOR

hostname was developed by the University of California, Berkeley. 

SEE ALSO

uname(1), gethostname(2), sethostname(2), uname(2), hostname(5). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026