NIS Client Networking  «Prev  Next»
Lesson 3 Obtaining Information about the Network
ObjectiveObtain Information about the Network

Obtaining Information about the Network

Using NIS, you can obtain information about your network and the hosts on it. There are five functions used with NIS, all of which begin with "yp".
The following table below contains an explanations of each function.

yp functions: 1) ypbind, 2) ypcat, 3) ypwhich, 4) ypmatch, 5) yppoll

Red Hat yp functions
These functions are powerful diagnostic tools. You can use them to check network configuration and your computer's interface to the NIS system. The commands ypwhich and ypmatch retrieve information about NIS servers and the information they have available.


The ypwhich command prints the name of your NIS server by default. When you pass the name of a NIS database to ypwhich (for example, if you type ypwhich -m hosts), it responds with the name of the master NIS server for that class of information (in this example, hostnames). If you are using separate NIS servers for different information, or if you need to check your NIS server name configuration, use ypwhich.


ypmatch lists the values of certain keys[1] in a given database. For example, the command line ypmatch host1 host2 hosts will return the values of the host1 and host2 keys from the hosts database; the associated values are the IP addresses assigned to their interfaces.
The next lesson describes the function and purpose of nsswitch.conf.

NIS command Matching

Before moving on to the next lesson, click the link below to read about the NIS commands and their functions.
NIS command Matching

[1]Key: In databases, a key is a parameter that holds a value. For example the value of hostname could be its IP address.