domainname Command
Purpose
Displays or sets the name of the current Network Information Service (NIS) domain.
Syntax
/usr/bin/domainname [ DomainName ]
Description
The domainname command displays or sets the name of the current NIS domain. If you do not specify a parameter, the domainname command displays the name of the current NIS domain. A domain typically encompasses a group of hosts under the same administration.
Only the root user can set the name of the domain by giving the domainname command an argument.
Security
Attention RBAC users: This command can
perform privileged operations. Only privileged users can run privileged operations. For more
information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the
authorizations that are associated with this command, see the lssecattr
command or the getcmdattr subcommand.
Examples
- To join a new domain, enter:
In this example, the domainname command sets the NIS domain name to caesar.domainname caesar - To find out the name of the domain your machine belongs to, enter:
domainname