Before starting the configuration of your NIS server, you need to decide on a NIS domain. Each NIS server will only serve clients from the domain that it is a part of. This domain is not to be confused with your DNS domain name and for security reasons, should not be the same as your DNS name. The NIS domain system allows you to divide the computers on your network into sub-domains that are served by NIS master servers for that domain only. The NIS domain name parameter is set by the nisdomainname command.
Equivalent commands are ypdomainname and domainname.
They all do the same. This command will need to be run on every machine on your network that will be part of the domain. You should put the above in your system startup scripts so that the domain name is automatically set at boot. However, root on the client machines will be able to view the encrypted password. Go through the options at the top.