Network Information Service (NIS) B.11.31.04 Administrator's Guide

NOTE: Back up the /etc/rc.config.d/namesvrs file and the /etc/
nsswitch.conf file before you perform the steps described in this section.
1. Log in as a superuser to the host that is designated as the master server.
2. Add the directory paths /var/yp, /usr/lib/netsvc/yp, and /usr/ccs/bin
in the $PATH environment variable:
# export PATH=$PATH:/var/yp:/usr/lib/netsvc/yp:/usr/ccs/bin
Verify that the directory paths /var/yp, /usr/lib/netsvc/yp, and /usr/
ccs/bin are successfully added in the $PATH environment variable:
# echo $PATH
The system displays all the paths that the PATH environment variable contains:
/var/yp:/usr/lib/netsvc/yp:/usr/ccs/bin
3. Set up the NIS domain name:
# /usr/bin/domainname domainname
where:
domainname is the name of the NIS domain being set up. For example,
/usr/bin/domainname marketing.
If the host, which is an NIS master server, uses short file names, ensure that the
first 14 characters of the domainname uniquely identify the NIS domain in the
network.
4. In the /etc/rc.config.d/namesvrs file, set the NIS_DOMAIN variable to the
domain name:
NIS_DOMAIN=domainname
5. In the /etc/rc.config.d/namesvrs file, set the NIS_MASTER_SERVER and
NIS_CLIENT variables to 1:
NIS_MASTER_SERVER=1
NIS_CLIENT=1
Setting the NIS_MASTER_SERVER variable to 1, makes the system an NIS master
server. Similarly, setting the NIS_CLIENT variable to 1, makes the system an NIS
client. Although it is a common practice to have both NIS client and NIS server
on the same system, it is not mandatory. You can maintain the NIS client and NIS
server on different systems.
6. Create the NIS maps for the domain:
# /usr/sbin/ypinit -m
The ypinit script prompts you to enter the names of the slave servers.
7. Enter the names of the slave servers.
The ypinit procedure displays few questions. For detailed information about
NIS network configuration, see Appendix A (page 65).
30 Configuring and Administering an NIS Master Server