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

Binding an NIS Client to a Server on a Different Subnet
This section describes how to bind an NIS client to an NIS server on a different subnet
or to a specific server on the same subnet.
To bind an NIS client to any of the specified NIS servers on a different subnet, complete
the following steps:
1. Log in to the NIS client as a superuser.
2. Construct a list of bind servers:
#/usr/sbin/ypinit -c
The ypinit command when invoked with the -c option, configures the local host
as an NIS client so that the NIS client attempts to bind to a particular NIS server.
Invoking the ypinit command with the -c option prompts you to construct a
list of NIS servers, in the order of preference, to which the NIS client will try to
bind. This list of NIS servers is stored in the /var/yp/binding/<domainname>/
ypservers file.
Add the names of NIS servers in order of preference, one server name on each
line. When you have no more names to add, press Ctrl+d or the Enter key on an
empty line. In this example, there are no hosts in the list. As a result, the default
host connects to all available servers.
next host to add:
The current list of yp servers looks like this:
mammoth
ocelot
Is this correct? [y/n: y] y
Type y or n and press the Enter key to confirm the output.
NOTE: Ensure that the /etc/hosts file has appropriate entries for the NIS
servers added above.
3. Copy the /etc/nsswitch.nis file to the /etc/nsswitch.conf file:
# cp /etc/nsswitch.nis /etc/nsswitch.conf
CAUTION: Any customized files may be overwritten while copying the /etc/
nsswitch.nis file in the/etc/nsswitch.conf directory.
4. Restart the NIS client:
# /sbin/init.d/nis.client stop
# /sbin/init.d/nis.client start
Binding an NIS Client to a Server on a Different Subnet 57