Solaris Naming Administration Guide

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:

% ypcat mapname

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

% ypcat -k mapname

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

% ypcat -x

% ypwhich -x

% ypmatch -x

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

% ypwhich -m

To list the master server for a particular map, type:

% ypwhich -m mapname

To match a key with an entry in a map, type:

% ypmatch key mapname

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

% ypcat mapname | grep item

Where item is the information you are searching for. 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, it causes ypbind to consult the /var/yp/binding/domainname/ypservers file for a list of servers for that domain. If this file doesn't 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.