nodename - local source for system name
When a machine is standalone or its IP address is configured locally, the svc:/system/identity:node SMF service has a property, namely nodename, for setting the system name.
To set the name of the node permanently use the following command:
# hostname mynodename
To set the name of the node temporarily use the following command:
# hostname -t mynodename
To see the current effective hostname:
To see the currently set nodename for the host use the following command:
$ svcprop -p config/nodename svc:/system/identity:node
The value of this property used to be located in the /etc/nodename file. If /etc/nodename is present and the SMF service property is not set, the SMF service reads /etc/nodename and populates the property.
Once the SMF service property has been set, the /etc/nodename file is removed and no longer consulted.
The config/nodename service property is not the only source used by the service for configuring the system name. By default the service uses the following sources for determining the system name:
If the machine's network configuration is delivered by the RPC bootparams protocol, neither the SMF service property nor the /etc/nodename file are used, as the system name is delivered by the remote service.
If the machine's network configuration is delivered by the DHCP protocol, the SMF service property is used only if the DHCP server does not provide a value for the Hostname option (DHCP standard option code 12).
If no other sources for the system name exist, then the config/nodename service property value is used. This default behavior is overridden whenever hostname(1) is used to manually configure a hostname. In this case, the config/nodename property value will serve as the persistent source for the system name. The hostname -D option may be used to return the system back to the default behavior. To determine whether or not the system is using the default behavior or not, use the following command:
$ svcprop -p config/ignore_dhcp_hostname svc:/system/identity:node
A value of “false” indicates that the service will use the default behavior to determine the system name. A value of “true” means the service will use the config/nodename property value as the system name.
Note that this default behavior may change and that the config/ignore_dhcp_hostname property may be removed in a future Oracle Solaris release.
A system name configured in the SMF service should be unique within the system's name service domain in order to ensure that any network services provided by the system operate correctly.
Given a system name value, regardless of source, uname –S sets the system name of the running system.
If the system is installed or configured using sysconfig(8) with a manual network configuration, /etc/inet/hosts is updated to map the nodename to the IP Address of the configured interfaces.
If the system is installed or configured with a network configuration not defined manually, /etc/inet/hosts is updated to map the nodename to the loopback entries.
If the system is installed or configured with no network interfaces, /etc/inet/hosts is updated to map the nodename to the loopback entries.
If the administrator chooses to prevent any of this mapping behavior, the administrator can set the config/enable_mapping svc:/system/identity:node service property to false in the AI install manifest.
The syntax for nodename consists of a single line containing the system's name. For example, for a system named myhost:
See attributes(7) for descriptions of the following attributes:
The nodename file is modified by Solaris installation and de-installation scripts.