Directs a client machine to a specific server.
The ypset command directs the ypbind daemon on the client to the ypserv daemon on the server. The ypbind daemon goes to the server you specify in the Server parameter to get Network Information Services (NIS) services for the domain you specify in the Domain parameter. The ypbind daemon gets the NIS services from the ypserv daemon on the server.
After the binding is set, it is not tested until a client process (such as the ypcat command or the ypwhich command) tries to get a binding for the domain. If the attempt to bind fails (the specified server is down or is not running the ypserv daemon), the ypbind daemon makes another attempt to bind for the same domain.
Specify either a name or an Internet Protocol (IP) address in the Server parameter. If you specify a name, the ypset command attempts to resolve the name to an IP address through the use of the NIS service. This works only if your machine has a current valid binding for the domain in question. In most cases, you should specify the server as an IP address.
In cases where several hosts on the local network are supplying NIS services, the ypbind daemon can rebind to another host. If a server is down or is not running the ypserv daemon, the ypbind daemon rebinds the client to another server. In this way, the network information service balances the load among the available NIS servers.
Use the ypset command if the network:
An alternative to using ypset is to use the /var/yp/binding/domain_name/ypservers file. This file, if present, should contain a list of NIS servers to attempt to bind to, one server per line. If the ypbind daemon cannot bind to any of the servers in the ypservers file, then it will attempt to use the server specified by ypset. If that fails, it will broadcast on the subnet for a NIS server.
Item | Description |
---|---|
-d Domain | Specifies a domain other than the default domain. |
-h Host | Sets the binding for the ypbind daemon on the specified host instead of on the local host. The host can be specified as a name or as an IP address. |
-V1 | Binds the specified server for the (old) version 1 NIS protocol. |
To set a server to bind on a host in a particular domain, enter:
ypset -d ibm -h venus mars
In this example, the ypset command causes the host named venus to bind to the server named mars.