NIS allows you to administer the configuration of many hosts
from a central location. Common configuration information, which
would have to be maintained separately on each host in a network
without NIS, can be stored and maintained in a central location
and propagated to all of the nodes in the network.
Information
Managed by NIS |
 |
By default, NIS manages the following configuration files:
/etc/hosts, a file that maps internet addresses to host names.
/etc/passwd, a list of the users on your system, along with
their passwords, home directories, and other information.
/etc/group, a list of groups of users.
/etc/netgroup, a list of NFS netgroups, which are groups of
host names or user names used for allowing or denying access to
systems and services.
/etc/services, a file that associates network services with
their port numbers and protocols.
/etc/protocols, a file that associates network protocols with protocol
numbers.
/etc/networks, a list of network names and numbers.
/etc/rpc, a file that maps RPC program names to program numbers.
/etc/auto_master, an NFS AutoFS map that lists the direct and indirect
AutoFS maps and their mount points.
/etc/mail/aliases, a list of sendmail aliases.
/etc/publickey, a list of secure RPC encryption keys.
/etc/netid, a list of secure RPC netnames (unix.UID@domainname or unix.hostname@domainname) for users and hosts outside your NIS domain.
/etc/vhe_list, a configuration file for the Virtual Home Environment.
(Type man 4 vhe_list for more information.) VHE is not supported on 10.0
and later releases.
The information in these files is put into NIS databases automatically when
you create an NIS master server. Other system files may be managed
by NIS, if you wish to customize your configuration.
Structure
of the NIS Network |
 |
The center of the NIS network is the NIS master
server. When you create an NIS master server, the configuration
files on that host are used to create NIS maps,
which are hashed database versions of the configuration files. Once
the NIS network is set up, any changes to the maps must be made
on the master server.
In addition to the master server, you can create backup servers,
called NIS slave servers, to take some load
off the master server and to substitute for the master server when
it is down. When you create an NIS slave server, the maps on the
master server are transferred to the slave server. Whenever a change
is made to a map on the master server, the modified map must be
transferred to the slave servers.
Typically, all the hosts in the network, including the master
and slave servers, are NIS clients. Whenever
a process on an NIS client requests configuration information, it
calls NIS instead of looking in its local configuration files. (For
group and password information and mail aliases, the /etc files may be consulted first, and NIS may be consulted
if the requested information is not found in the /etc files.)
The set of maps shared by the servers and clients is called
the NIS domain. The master copies of the
maps are located on the NIS master server, in the directory /var/yp/domainname. Under the domainname directory, each map is stored as two files: mapname.dir and mapname.pag. Each slave server has an identical directory
containing the same set of maps.
When a client starts up, it broadcasts a request for a server
that serves its domain. Any server that has the set of maps for
the client’s domain may answer the request. The client “binds” to
the first server to answer its request, and that server answers
all of its NIS queries.
Figure 4-1 “Flow
of Information in an NIS Network” shows the flow
of information in an NIS domain.
A host cannot be the master server for more than one NIS domain. However,
a master server for one domain may be a slave server for another
domain. A host can be a slave server for multiple domains. A client
belongs to only one domain. Figure 4-2 “Servers
that Server Multiple NIS Domains” shows
an NIS network with servers that serve multiple domains.