Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Understanding NIS

As you configure your network, you will find that some of your configuration files are not host specific, but they require frequent updating. /etc/passwd and /etc/group are two that come to mind. NIS enables you to set up a master server where these files are stored and then configure each machine on your network as clients to this server. Whenever a client needs to fetch an entry from the /etc/passwd file, it consults the NIS server instead.

Two prerequisites must be met in order for a file to be sharable via NIS. First, the file must be tabular with at least one entry that is unique across the entire file. In the /etc/passwd file, this entry is either the login or UID. Second, the file in its raw form must be a straight text file.

With the criteria met, the files are converted into DBM files, a simple database format allowing for quick searches. You must create a separate DBM for each key to be searched. In the /etc/passwd file, for instance, you need the database to be searchable by login and by UID. The result is two DBM files, passwd.byname and passwd.byuid.

The original text file, along with the DBM files created from it, is maintained at the NIS master server. Clients that connect to the server to obtain information do not cache any returned results.

NIS Domains

NIS servers and clients must be in the same NIS domain to communicate with one another. Note that the NIS domain is not the same as a DNS domain, although it is valid for them to share the same name.

Both the clients and servers bind themselves to a domain; hence, a client can only belong to one NIS domain at a given time. Once bound, clients send a broadcast to find the NIS server for the given domain.

The Different Servers

So far, you might have noticed that I've referenced the NIS server explicitly as the master server. The two kinds of NIS servers are master servers and slave servers.

Master NIS servers are the actual truth holders. They contain the text files used to generate the DBM files, and any changes to the database must be made to these files.

Slave NIS servers are designed to supplement master NIS servers by taking some of the load off. When a file is updated on the server, a server push is initiated and the slave NIS server gets an updated copy of the DBM files.

Share ThisShare This

Informit Network