NIS Client Networking  «Prev  Next»
Lesson 2NIS: Network Information System
ObjectiveDescribe the Network Information System.

NIS - Network Information System

It is important that every computer on a network has access to certain information. If you use simple configuration files, each host will need exactly the same information at all times. However, for large and dynamic networks, this is simply impractical because the information is complex and constantly changing. The Network Information Server (NIS) solves this problem by maintaining network information in a database on a server. Any client on the network can then access the database for information on hosts, users, passwords, and more.

Requirements

In order for a client to use NIS, it must be running two daemons.
  1. The first daemon, portmap, allows applications running on the NIS client computer to obtain network information from the NIS server.
  2. The second daemon, ypbind, is the NIS client daemon itself.
The "yp" found in most NIS tool names stands for Yellow Pages(tm), the former name of NIS. You can think of NIS as a similar type of information resource for your network.

portmap daemon in Red Hat Linux

The portmap daemon in Red Hat Linux serves as a mediator between network services and the port numbers they use. It is responsible for mapping port numbers to the correct network service on a server, allowing clients to connect to the correct service using the correct port number. The portmap daemon listens on the well-known port 111 and responds to queries from client programs requesting information about network services. This information is then used by client programs to establish connections to network services running on the server. The portmap daemon is an essential component of the RPC (Remote Procedure Call) system used by many network services in Red Hat Linux.

NIS Network Structure

NIS servers store information in databases, sometimes called maps. For example, you can have maps of hostnames to IP addresses, or users to passwords. Each map has a master server. This server is responsible for keeping all information up-to-date and available to clients. You can also set up slave servers, which merely keep an accurate copy of the master's database and handle NIS requests when the master is busy. The following series of images below explores some different ways NIS networks are organized.

Network Information System and NIS Client Networking

1) The NIS Server holds information in a database or map. The portmap utility coordinates communication between the server and client applications.
1. The NIS Server holds information in a database or map. The portmap utility coordinates communication between the server and client applications. Each type of information (such has host-name to IP address translation) has a particular server that acts as the master for that information.

2) Clients send requests to the server and wait for the information. If the NIS server does not reply, secondary services, such as DNS or the local Host Table are checked.
2. Clients send requests to the server and wait for the information. If the NIS server does not reply, secondary services, such as DNS or the local Host Table are checked.

3) There can be several master servers for each map. Administrators set up multiple servers to handle the many requests made by hosts on large networks.
3. There can be several master servers for each map. Administrators set up multiple servers to handle the many requests made by hosts on large networks. A configuration file tells each client which NIS server to use.

4) NIS also allows servers to have slave servers, which hold copies of the maps in the master server. The slaves are updated whenever the map changes. On large networks NIS servers need slaves simply to handle all the information requests.
4. NIS also allows servers to have slave servers, which hold copies of the maps in the master server. The slaves are updated whenever the map changes. On large networks, NIS servers need slaves simply to handle all the information requests. A network can have a mix of masters and slaves on each map.

NIS Server

Defining an NIS domain name

You can set your Red Hat Linux computer's NIS domain name using the domainname command. For example, if your NIS domain name were ooportal, you could set it by typing the following as the root user from the shell:
domainname cplusoop

Set NIS domain name

To verify that your NIS domain name is set, simply type domainname and you will see the name. Unfortunately, you are not done yet. Running domainname does not set the NIS domain name permanently. As soon as you reboot the computer, it is gone. (You can verify this by typing domainname again.) To make the NIS domain name permanent, you need to have the domainname command run automatically each time your system boots. There are many ways to do this.
What I did was add the command line (domainname trident) to a run−level script that runs before the ypbind daemon is started. I edited the /etc/init.d/network file and added the following lines just after the first set of comment lines (about line number 9).

# Set the NIS domain name.
domainname trident

This caused my NIS domain name to be set each time my Red Hat Linux system booted. When you add this entry, make sure you spell the NIS domain name properly (including upper- and lowercase letters). If you get it slightly wrong, you will see ypbind failure messages when you boot.
Caution: Be very careful editing a run level script. Make a copy before you edit it. If you make a mistake editing one of these files, you could find yourself with a network or other essential service that does not work.
The next lesson shows you how to obtain information about the network.