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

A Sample NIS Session
This appendix discusses a sample configuration for an NIS network, where we configure an NIS
master (hostname: mammoth), NIS slave (hostname:ocelot) and an NIS client for the domain
marketing.
The following topics are addressed here:
“Configure an NIS Master Server” (page 49)
“Configure an NIS Slave Server” (page 50)
“Configure an NIS Client” (page 51)
Configure an NIS Master Server
1. Modify the /etc/rc.config.d/namesvrs file and set the fields mentioned as follows:
NIS_MASTER_SERVER=1
NIS_SLAVE_SERVER=0
NIS_CLIENT=1
NIS_DOMAIN=marketing
2. Enter the following command to setup the local host as the master server for all maps:
#/usr/sbin/ypinit -m
The ypinit procedure starts by asking a few questions in order to properly install NIS in
your environment.
Do you want this procedure to quit on non-fatal errors? [y/n: n] n
Remember to correct anything which fails. If you do not, some part of the system (perhaps
the NIS itself) may not work.
Can the existing directory "/var/yp/marketing" and its contents be destroyed? [y/n: n] y
At this point, you must construct a list of the hosts that will be NIS servers (both master and
slave) for the marketing domain.
This machine, mammoth, is in the list of Network Information Service servers.
Provide the hostnames of the slave servers, one per line. When you have no more names to
add, enter Ctrl+D or a blank line.
next host to add: mammoth
next host to add: ocelot
next host to add
The current list of NIS servers looks like this:
mammoth
ocelot
Is this correct? [y/n: y]
There will be no further questions. The remainder of the procedure should take 5 to 10
minutes.
Building the ypservers database... ypservers build complete.
Running make in /var/yp: updated passwd updated group updated hosts updated ipnodes updated networks
updated rpc updated services updated protocols updated netgroup updated aliases updated publickey updated
netid updated auto.master
mammoth has been set up as a master Network Information Service server without any errors.
If there are running slave NIS servers, run yppush (1M) for any databases which have been
changed. If there are no running slaves, run ypinit on those hosts which are to be slave
servers.
3. Configure NIS Master as an NIS Client.
# /bin/rm -f /var/yp/binding/marketing/ypservers
# /usr/sbin/ypinit -c
Configure an NIS Master Server 49