ypwhich Command
Purpose
Identifies either the Network Information Services (NIS) server or the server that is the master for a given map.
Syntax
To Identify the NIS Server
/usr/bin/ypwhich [ -d Domain ] [ -V1 | -V2 ] [ HostName ]
To Identify the Master NIS Server for a Map
/usr/bin/ypwhich [ -t ] [ -d Domain ] [ -m [ MapName ] ]
To Display the Map Nickname Table
/usr/bin/ypwhich -x
Description
The ypwhich command identifies which server supplies Network Information Services (NIS) services or which server is the master for a map, depending on how the ypwhich command is invoked. If invoked without arguments, this command displays the name of the NIS server for the local machine. If you specify a host name, the system queries that host to find out which master it is using.
Flags
Item | Description |
---|---|
-d Domain | Uses the specified domain instead of the default domain. |
-V1 | Indicates which server is serving the old version 1 NIS protocol client processes. |
-V2 | Indicates which server is serving the current version 2 NIS protocol client processes. If neither version is specified, the ypwhich command attempts to locate the server that supplies the version 2 services. If there is no version 2 server currently bound, the ypwhich command then attempts to locate the server supplying version 1 services. Because servers and clients are both backward-compatible, the user need seldom be concerned about which version is currently in use. |
-t | Inhibits nickname translation, which is useful if there is a map name identical to a nickname. |
-m MapName | Finds the master NIS server for a map. No host can be specified with the -m flag. The MapName variable can be a map name or a nickname for a map. When the map name is omitted, the -m flag produces a list of available maps. |
-x | Displays the map nickname table. This lists the nicknames (MapName) the command knows of and indicates the map name associated with each nickname. |
Examples
- To find the master server
for a map, type:
In this example, the ypwhich command displays the name of the server for theypwhich -m passwd
passwd
map. - To find the map named passwd,
rather than the map nicknamed passwd, type:
In this example, the ypwhich command displays the name of the server for the map whose full name isypwhich -t -m passwd
passwd
. - To find out which server
serves clients that run the old version 1 of the NIS protocol, type:
ypwhich -V1
- To display a table of
map nicknames, type:
ypwhich -x