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

NOTE: If an IP address needs to be mapped to multiple host names, include them as aliases
in a single entry.
7. Sort the hosts.temp file by host name, as follows:
sort -o /etc/nis/hosts.temp -b -k2,2 /etc/nis/hosts.temp
8. Examine the /etc/nis/hosts.temp file for duplicate host names. A host name may be
mapped to multiple IP addresses only if the IP addresses belong to different LAN cards on
the same host. If a host name appears in multiple entries mapped to IP addresses on different
hosts, remove all the duplicate entries.
9. Examine the /etc/nis/hosts.temp file for duplicate aliases.
NOTE: Ensure that an alias does not appear in more than one entry.
10. Move the sorted /etc/nis/hosts.temp file to the /etc/hosts file.
The /etc/hosts file is used to generate the hosts map for the NIS domain.
11. Remove the /etc/nis/hosts.hostname files from the master server. For example, for
a host ocelot, the hosts file named /etc/nis/hosts.ocelot must be removed.
For more information about the hosts file, see hosts (4). For more information about the sort
command, see sort (1).
Enabling the NIS Master Server Capability
To enable the master server capability, complete the following steps:
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 superuser to the host that is designated as the master server.
2. Ensure that the $PATH environment variable includes the following directory paths:
/var/yp
/usr/lib/netsvc/yp
/usr/ccs/bin
3. Enter the following command to 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 hosts use 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, as follows:
NIS_DOMAIN=domainname
5. In the /etc/rc.config.d/namesvrs file, set the NIS_MASTER_SERVER and NIS_CLIENT
variables to 1, as follows:
NIS_MASTER_SERVER=1
NIS_CLIENT=1
Setting the NIS_MASTER_SERVER variable to 1, makes the system an NIS master. Similarly,
setting the NIS_CLIENT variable to 1, makes the system an NIS client. Although it is a
24 Configuring and Administering an NIS Master Server