System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

Obtaining Map Information

Users can obtain information from and about the maps at any time by using the ypcat, ypwhich, and ypmatch commands. In the examples that follow, mapname refers both to the official name of a map and to its nickname, if any.

To list all the values in a map, type the following.


% ypcat mapname

To list both the keys and the values (if any) in a map, type the following.


% ypcat -k mapname

To list all the map nicknames, type any of the following commands.


% ypcat -x
% ypmatch -x
% ypwhich -x

To list all the available maps and their master(s), type the following.


% ypwhich -m

To list the master server for a particular map, type the following.


% ypwhich -m mapname

To match a key with an entry in a map, type the following.


% ypmatch key mapname

If the item you are looking for is not a key in a map, type the following.


% ypcat mapname | grep item

where item is the information for which you are searching. To obtain information about other domains, use the -d domainname options of these commands.

If the machine requesting information for a domain other than its default does not have a binding for the requested domain, ypbindconsults the /var/yp/binding/domainname/ypservers file for a list of servers for that domain. If this file does not exist it issues an RPC broadcast for a server. In this case, there must be a server for the requested domain on the same subnet as the requesting machine.