Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

hostname(1)

Name

hostname - set or print name of current host system

Synopsis

/usr/bin/hostname [[-t] name-of-host]
/usr/bin/hostname [-D]

Description

The hostname command prints the name of the current host, as given before the login prompt. The super-user can set the hostname by giving an argument. The change of the hostname is permanent unless the –t option is specified.

By default, any system configured as a DHCP client will use the hostname returned by DHCP as its hostname. This default behavior is altered once the hostname is set manually using the hostname command. The –D option can be used to return the system back to the default behavior so that any DHCP client hostname will be given precedence over the manually defined hostname. Note that this default behavior may change in a future Solaris release and the semantics of the –D option might change to reflect any such change.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os

See Also

uname(1), nodename(5), attributes(7)