Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ypmatch(1yp) [ultrix man page]

ypmatch(1yp)															      ypmatch(1yp)

       ypmatch - print the value of one or more keys from a yp map

       ypmatch [-d domain] [-k] [-t] key... mname
       ypmatch -x

       The command prints the values associated with one or more keys from the yellow pages (YP) map (database) specified by a mname, which may be
       either a mapname or a map nickname.

       Multiple keys can be specified.	After the key values and the map name have been specified, searches the map for all of the specified keys.
       The  specified  keys  must be exact values in terms of capitalization and length.  The command does not have a pattern matching capability.
       If cannot match a key, it produces a diagnostic message.

       The default list of mapnames served by YP is as follows:

       Note that the YP server must be running ULTRIX Version 4.2 or higher for the and maps to exist.	Also note that the map	is  accessed  with
       port numbers, not service names.  Use the map to access services by name.  The map remains for compatibility.  See the Examples section for
       sample command lines that illustrate how to access information in each of the maps.

       -d Displays key values for specified domain.

       -k Displays key, followed by a colon (:), before displaying value of the key.  This is useful  if  the  keys  are  not  duplicated  in  the
	  returned values, or if the number of specified keys is so large that the output is confusing.

       -t Inhibits translation of nickname to mapname.	For example,
	  ypmatch -t zippy passwd
	  fails because there is no map named passwd, while
	  ypmatch zippy passwd
	  succeeds because translates it to
	  ypmatch zippy passwd.byname.

       -x Displays map nickname table.	This option tells to list the nicknames (mnames) with their associated mapnames.

       The following are sample command lines that illustrate how to use the command to access information in each of the maps:

       Mapname		       Sample command
       passwd.byname	       ypmatch user1 passwd.byname
       passwd.byuid	       ypmatch uid1 passwd.byuid
       group.byname	       ypmatch group1 group.byname
       group.byuid	       ypmatch gid1 group.bygid
       hosts.byname	       ypmatch host1 host.byname
       hosts.byaddr	       ypmatch hostaddr1 hosts.byaddr
       networks.byname	       ypmatch network1 networks.byname
       networks.byaddr	       ypmatch netaddr1 networks.byaddr
       services.byname_proto   ypmatch service1/udp services.byname_proto
       services.byport	       ypmatch servport/tcp service.byport
       services.byname	       ypmatch servport/tcp services.byname
       rpc.bynumber	       ypmatch rpcnum rpc.bynumber
       protocols.byname        ypmatch proto1 protocols.byname
       protocols.bynumber      ypmatch protonum1 protocols.bynumber
       netgroup.byuser	       ypmatch user1 netgroup.byuser
       netgroup.byhost	       ypmatch host1 netgroup.byhost
       mail.alias	       ypmatch mailgroup1 mail.alias

See Also
       ypfiles(5yp), ypcat(1yp)
       Guide to the Yellow Pages Service


Check Out this Related Man Page

ypfiles(4)						     Kernel Interfaces Manual							ypfiles(4)

ypfiles - Network Information Service database and directory structure DESCRIPTION
The Network Information Service (NIS) was formerly known as Yellow Pages (YP). Although the name has changed, the functionality of the service remains the same. The Network Information Service (NIS) network lookup service uses databases in the directory hierarchy under These databases exist only on machines that act as NIS servers. A database consists of two files created by (see makedbm(1M)). One has the filename extension and the other has the filename extension For example, the database named is implemented by the pair of files and A database served by the NIS is called an NIS map. An NIS domain is a named set of Network Information Service maps. Each NIS domain is implemented as a subdirectory of (whose name is the domain name) and contains the maps for that domain. Any number of NIS domains can exist, and each can contain any number of maps. Besides the databases contained in master NIS servers have files named that reside there, too. These files are merely empty files whose times of last modification are compared with those of the ASCII files from which the maps are built. The script performs these comparisons to determine whether the maps are current (see ypmake(1M)). The general_NIS_mapname designation is described further in the section below. The NIS lookup service does not require maps, although maps may be required for the normal operation of other parts of the system. The list of maps an NIS server provides access to is neither restricted nor must it be all-inclusive. If a map exists in a given domain and a client asks about it, the NIS serves it. For a map to be consistently accessible, it must exist on all NIS servers that serve the domain. To provide data uniformity between the replicated maps, make an entry to run periodically in root's file on each server (see ypxfr(1M) and crontab(1)). More information on this topic is in yppush(1M) and ypxfr(1M). NIS maps contain two special key-value pairs. The first key, NIS_LAST_MODIFIED, has a 10-character (ASCII) order number as a value. The order number is the in seconds when the map was built (see time(2)). The second key is NIS_MASTER_NAME, whose value is the host name of the map's master NIS server. The command generates both key-value pairs automatically. The command uses these values when it transfers a map from one NIS server to another. Generate and modify NIS maps only on the master server. They are copied to the slaves using to avoid potential byte-ordering problems among NIS servers running on machines with different architectures, and to minimize the disk space required for the databases (see ypxfr(1M)). NIS databases can be created initially for both masters and slaves by using (see ypinit(1M)). After servers' databases are created, the contents of some maps will change. Generally, an ASCII source version of each database exists on the master, and is changed with a text editor. The NIS map is rebuilt to include the changes, and propagated from the master to the slaves by running the shell script (see ypmake(1M)). All standard NIS maps are built by commands contained in the script or the NIS If you add a non-standard NIS map, edit the script or to support the new map (standard NIS maps are discussed under below). and use to generate the NIS maps on the master and may run to copy the rebuilt maps to the slaves (see yppush(1M)). The command reads the map named that contains the host names of all NIS servers for the spe- cific domain. For more information, see ypmake(1M), yppush(1M), and ypxfr(1M). Standard nicknames are defined in the file These names can be used in place of the full map name in the and commands. Use the command to display the current set of nicknames. Use the command to display all the available maps. Each line of the nickname file contains two fields separated by white space. The first field is the nickname, and the second field is the name of the map that it expands to. The nickname cannot contain a period DEPENDENCIES
If is in a file system that does not allow file names longer than 14 characters and you want to create a new non-standard map for the Net- work Information Service, its name must not exceed 10 characters in length. This rule exists because adds the 4-character suffixes and to any mapname. The following table describes the translation of standard NIS mapnames to shorter names for storage on a 14-character filename file system. The standard mapnames should be used by NIS clients on HP machines when making requests, regardless of which machine is the NIS server. +---------------------+---------------------+ |Standard NIS Mapname | Abbreviated Mapname | +---------------------+---------------------+ |auto.master | auto.mast | |ethers.byaddr | ether.byad | |ethers.byname | ether.byna | |group.bygid | group.bygi | |group.byname | group.byna | |hosts.byaddr | hosts.byad | |hosts.byname | hosts.byna | |ipnodes.byaddr | ip.byad | |ipnodes.byname | ip.byna | |mail.aliases | mail.alias | |mail.byaddr | mail.byad | |netgroup | netgroup | |netgroup.byhost | netgr.byho | |netgroup.byuser | netgr.byus | |netid.byname | netid.byn | |networks.byaddr | netwk.byad | |networks.byname | netwk.byna | |passwd.byname | passw.byna | |passwd.byuid | passw.byui | |protocols.byname | proto.byna | |protocols.bynumber | proto.bynu | |publickey.byname | pbkey.byna | |rpc.byname | rpc.byna | |rpc.bynumber | rpc.bynu | |services.byname | servi.byna | |ypservers | ypservers | +---------------------+---------------------+ +---------------------+---------------------+ AUTHOR
ypfiles was developed by Sun Microsystems, Inc. FILES
The following table presents information about the standard Network Information Service maps. The General NIS Mapname column lists names for sets of NIS maps; the sets include adjacent entries from the Standard NIS Mapname column. The ASCII Source column lists the ASCII files from which the maps are usually built on HP master NIS servers. The script permits the source directory, or file in the case of the passwd maps, to vary. The Standard NIS Mapname column lists names by which maps are stored on NIS servers and referred to by NIS clients. +------------+-------------------+--------------------+ |General NIS | ASCII Source | Standard NIS | |Mapname | | Mapname | +------------+-------------------+--------------------+ |aliases | /etc/mail/aliases | mail.aliases | | | | mail.byaddr | |automounter | /etc/auto_master | auto.master | |ethers | * | ethers.byaddr | | | | ethers.byname | |group | /etc/group | group.byname | | | | group.bygid | |hosts | /etc/hosts | hosts.byname | | | | hosts.byaddr | |ipnodes | /etc/hosts | ipnodes.byname | | | | ipnodes.byaddr | |netgroup | /etc/netgroup | netgroup | | | | netgroup.byhost | | | | netgroup.byuser | |netid | /etc/netid | netid.byname | |networks | /etc/networks | network.byaddr | | | | network.byname | |passwd | /etc/passwd | passwd.byname | | | | passwd.byuid | |protocols | /etc/protocols | protocols.byname | | | | protocols.bynumber | |publickey | /etc/publickey | publickey.byname | |rpc | /etc/rpc | rpc.byname | | | | rcp.bynumber | |services | /etc/services | servi.bynp | | | | services.byname | |ypservers | ** | ypservers | +------------+-------------------+--------------------+ +------------+-------------------+--------------------+ These databases are not built on HP master Network Information Service servers. However, if an HP machine is a slave to a master NIS server that creates and distributes these databases, the HP slave NIS server will store these databases. It is suggested that if you have a non-HP machine that requires these maps, make that machine the master NIS server. By doing this, the maps should be built as needed. No ASCII source exists for the database. It is created from responses provided by the user of on the master NIS server, and it has no matching file. SEE ALSO
domainname(1), makedbm(1M), rpcinfo(1M), ypinit(1M), ypmake(1M), yppoll(1M), yppush(1M), ypserv(1M), ypxfr(1M). ypfiles(4)
Man Page