Network Information Service (NIS) B.11.31.04 Administrator's Guide
# cat hosts hosts.hostname1 hosts.hostname2... > hosts.temp
5. Sort the temporary hosts file by IP address:
# sort -o /etc/nis/hosts.temp -b -k1,1 /etc/nis/hosts.temp
NOTE: The NIS master server does not require that the hosts file be sorted in
any particular way. However, sorting the hosts file facilitates the search for
duplicate entries.
6. Examine the /etc/nis/hosts.temp file for duplicate IP addresses, and remove
the duplicate entries:
# sort -o /etc/nis/hosts.temp -b -k3, /etc/nis/hosts.temp
NOTE: If an IP address needs to be mapped to multiple host names, include
them as aliases in a single entry.
You can verify how to change the IP address of a machine using System
Administration Manager (SAM). You must not remove the IP address, but modify
it.
7. Sort the hosts.temp file by host name:
# 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. Ensure that an
alias does not appear in more than one entry. If there are duplicate aliases,
consolidate them to correspond to a host name. For example, hostname: alias
1, alias 2, alias 3.
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
To enable the NIS master server capability, complete the following steps:
Enabling the NIS Master Server 29