Network Information Service (NIS) B.11.31.02 Administrator's Guide
Where:
IP_address Specifies the Internet address of the NIS client, the NIS slave server, or
the subnet that requests the NIS information or transfers from the NIS
master server
address_mask Indicates the important bit fields in the IP_address.
If a bit is set in the address_mask field, the corresponding bit in the
source address of any incoming NIS requests must match the same bit
in the IP_address field.
If a client or a slave host has multiple network interface cards, you must add the IP addresses
of all the network interfaces to the securenets file. However, this is not required if the
NIS server accepts requests on only one interface.
Example 1
The following entry from a /var/yp/securenets file allows only the NIS client at IP
address 20.21.12.13 to request information from the NIS master server:
255.255.255.255 20.21.12.13
Each bit is set in the address mask. Only the host whose IP address is 20.21.12.13 is allowed
access to the master server.
Example 2
The following entry from a /var/yp/securenets file allows any host on the network
20.21.12.13, to request NIS information or transfer NIS maps from the master server:
255.255.255.0 20.21.12.13
The last eight bits in the IP address are ignored, because the last eight bits of the address
mask are set to 0. Any host whose IP address begins with 20.21.12 is allowed access to the
master server.
NOTE: You must restart the ypserv process for the changes made to the
/var/yp/securenets file to be effective.
4. Enter the following commands to restart the ypserv process:
/sbin/init.d/nis.server stop
/sbin/init.d/nis.server start
For more information, see securenets (4).
Verifying the Contents of an NIS Map
To verify the contents of an NIS map, enter the following command:
/usr/bin/ypcat -k mapname
The -k option lists the key for each item in the map and the data associated with the key.
For example, in the netgroup.byhost map, the hostname is the key. If the -k option is not
specified, the ypcatcommand lists all the data associated with each netgroup name. However,
it does not list the key, hostname in this case.
For more information about the ypcat command, see ypcat (1).
Modifying an NIS Map
To modify an NIS map, complete the following steps:
1. Log in to the NIS master server as superuser.
2. Modify the source file of the NIS map. For example, if you want to modify the NIS hosts
map, modify the /etc/hosts file.
28 Configuring and Administering an NIS Master Server