NIS functions NIS NIS (formerly called Yellow Pages) allows network management of important administrative files (e.g. the password file). For more information refer to the NIS manpage and Introduction to YP/NIS. There is also a book called Managing NFS and NIS by Hal Stern. To get these functions to work, you have to configure PHP with . yp_get_default_domain Fetches the machine's default NIS domain. Description int yp_get_default_domain void yp_get_default_domain returns the default domain of the node or FALSE. Can be used as the domain parameter for successive NIS calls. A NIS domain can be described a group of NIS maps. Every host that needs to look up information binds itself to a certain domain. Refer to the documents mentioned at the beginning for more detailed information. Example for the default domain <?php $domain = yp_get_default_domain(); echo "Default NIS domain is: " . $domain; ?> yp_order Returns the order number for a map. Description int yp_order string domain string map yp_order returns the order number for a map or FALSE. Example for the NIS order <?php $number = yp_order($domain,$mapname); echo "Order number for this map is: " . $order; ?> See also yp-get-default-domain. yp_master Returns the machine name of the master NIS server for a map. Description string yp_master string domain string map yp_master returns the machine name of the master NIS server for a map. Example for the NIS master <?php $number = yp_master($domain, $mapname); echo "Master for this map is: " . $master; ?> See also yp-get-default-domain. yp_match Returns the matched line. Description string yp_match string domain string map string key yp_match returns the value associated with the passed key out of the specified map or FALSE. This key must be exact. Example for NIS match <?php $entry = yp_match($domain, "passwd.byname", "joe"); echo "Matched entry is: " . $entry; ?> In this case this could be: joe:##joe:11111:100:Joe User:/home/j/joe:/usr/local/bin/bash See also yp-get-default-domain yp_first Returns the first key-value pair from the named map. Description string[] yp_first string domain string map yp_first returns the first key-value pair from the named map in the named domain, otherwise FALSE. Example for the NIS first <?php $entry = yp_first($domain, "passwd.byname"); $key = key($entry); echo "First entry in this map has key " . $key . " and value " . $entry[$key]; ?> See also yp-get-default-domain yp_next Returns the next key-value pair in the named map. Description string[] yp_next string domain string map string key yp_next returns the next key-value pair in the named map after the specified key or FALSE. Example for NIS next <?php $entry = yp_next($domain, "passwd.byname", "joe"); if(!$entry) { echo yp_errno() . ": " . yp_err_string(); } $key = key($entry); echo "The next entry after joe has key " . $key . " and value " . $entry[$key]; ?> See also yp-get-default-domain.