To use ypinit to build a fresh set of NIS maps on the master server, do the following.
On the master server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
Copy the contents of the nsswitch.files file to the nsswitch.conf file.
# cp /etc/nsswitch.files /etc/nsswitch.conf
Edit the /etc/hosts or /etc/inet/ipnodes file to add the name and IP address of each of the NIS servers.
Build new maps on the master server.
# /usr/sbin/ypinit -m
When ypinit asks whether you want the procedure to terminate at the first nonfatal error or continue despite nonfatal errors, type y.
When you choose y, ypinit exits upon encountering the first problem; you can then fix it and restart ypinit. This is recommended if you are running ypinit for the first time. If you prefer to continue, you can try to manually fix all problems that occur, and then restart ypinit.
A nonfatal error can appear when some of the map files are not present. This is not an error that affects the functionality of NIS. You might need to add maps manually if they were not created automatically. Refer to Default NIS Maps for a description of all default NIS maps.
ypinit asks whether the existing files in the /var/yp/domainname directory can be destroyed.
This message is displayed only if NIS has been previously installed.
After ypinit has constructed the list of servers, it invokes make.
This program uses the instructions contained in the Makefile (either the default one or the one you modified) located in /var/yp. The make command cleans any remaining comment lines from the files you designated. It also runs makedbm on the files, creating the appropriate maps and establishing the name of the master server for each map.
If the map or maps being pushed by the Makefile correspond to a domain other than the one returned by the command domainname on the master, you can make sure that they are pushed to the correct domain by starting make in the ypinit shell script with a proper identification of the variable DOM, as follows:
# make DOM=domainname password
This pushes the password map to the intended domain, instead of the domain to which the master belongs.
To enable NIS as the naming service, type the following.
# cp /etc/nsswitch.nis /etc/nsswitch.conf
This replaces the current switch file with the default NIS-oriented switch file. You can edit this file as necessary.