Solaris Naming Setup and Configuration Guide

Starting NIS Service on the Master Server

Now that the master maps are created, you can start the NIS daemons on the master server and begin service. To do this, you have to start ypserv on the server and run ypbind. When a client requests information from the server, ypserv is the daemon that answers information requests from clients after looking them up in the NIS maps.

There are two ways that NIS service can be started on a server:

Starting NIS Service Automatically

After the NIS master server has been configured by running ypinit, ypstart is automatically invoked to start up ypserve when the machine is booted. (See "How to Set Up the Master Server With ypinit".)

Starting NIS From the Command Line

To begin NIS service from the command line, run the /usr/lib/netsvc/yp/ypstart script:


#/usr/lib/netsvc/yp/ypstart

Note -

Because there is a slight delay before ypserv is ready to respond to calls after startup, you should issue a three to five second sleep after ypstart when calling it from inside a program or script.


DNS Forwarding

In the Solaris 7 release, if the /etc/resolv.conf file is present ypstart will start up ypserve with DNS forwarding. If you do not want the DNS forwarding option set, edit the /usr/lib/netsvc/yp/ypstart script to remove the -d option from the ypserv command. You must then reboot the machine.

For more information about using NIS with DNS, refer to Chapter 13, Setting Up DNS Servers and Solaris Naming Administration Guide.

Stopping NIS with ypstop

To stop NIS service, run the ypstop command:


#/usr/lib/netsvc/yp/ypstop