With an argument, domainname sets the name of the secure NIS domain to newname (maximum of 255 characters). Setting the domain name can be performed by a privileged user only.
The /etc/rc2.d/S51domain script normally sets the name of the secure NIS domain when the system boots.
Note that any changes to the domain name made using the domainname command are temporary. The new domain name will be overridden when the system is next rebooted.
To change the domain name permanently, stop NIS using the command sh /etc/init.d/nis stop, and then rerun ypinit(1Mnis).