To Create an NIS Client NIS Domain Name

cat tmpypservers | usrsbinmakedbm − varyp domainname ypservers The new slave server is now included into the ypservers map, and the master server will treat it correspondingly. The master server uses the ypservers map to identify registered slave servers for NIS databases pushing. NIS clients do not base their binding to the slave servers on this map; clients do not check servers for eligibility, they simply trust servers. This means that even if this map is not propagated after an update, it will not affect overall NIS behavior. But this also means, that a not−registered slave server could be accepted by clients as the eligible one, which is a security risk. The ypcat command is used to read the contents of the NIS maps; its −k option which prints each value with the preceding associated key is required in the case of the ypservers map. 17.2.2.4 Start NIS Service Finally, when ypinit −s finishes, the NIS service should be started manually by initiating the ypserv daemon simply by issuing the ypserv command, or ypstart command, or even the corresponding rc start script for NIS.

17.2.3 To Create an NIS Client

The procedure presented here is the traditional, and still the prevailing, approach for the majority of UNIX flavors in creating an NIS client; some modern UNIX flavors could require a slightly different procedure to accomplish the same task. Both approaches are addressed within the presented steps. Make sure that local etc files on the client host primarily etcpasswd and etcgroup include the NIS marker + as the last entry. The + marker indicates that the NIS map should be appended to the local configuration file; otherwise, the local configuration data will be ignored. Remember that modern UNIX flavors could handle this request differently, primarily through the etcnsswitch.conf file we will discuss this issue later. 1. Afterward, execute the domainname command to set the NIS domain name: domainname NISdomain. where NISdomain is the name of the NIS domain. 2. Finally, start the ypbind daemon, which is responsible for locating the closest NIS server and maintaining the binding with the chosen server the NIS rc startup script can be used instead. 3.

17.2.4 NIS Domain Name

We see that a host understands that it belongs to a certain NIS domain if it can locally extract the name of the NIS domain, that is, if the NIS domain is set on this host. There is no list of valid or invalid domain names, so any extracted name is accepted as valid; an NIS domain could simply be set with any extracted name or unset there is no extracted name. The host will accept that name and look up the corresponding NIS serverservers. The NIS domain name is an arbitrary name, but it is a good idea to use some logical names not because of the NIS hosts — for machines there are no senseless names; mostly because of us, to understand NIS organization more easily. There was an opinion in the past that some advantages exist if this name matches the DNS domain name. 409 The NIS domain name is set by the domainname command, and it is usually saved in the file etcdefaultdomain. For example, to set the name of the NIS domain to NISdomain, and then check out later, the following command sequence can be used: domainname NISdomain domainname NISdomain cat etcdefaultdomain on Solaris, HP−UX, SunOS … NISdomain Bear in mind that this is not the case for every UNIX flavor. Sometimes the specified NIS name is not even saved in any file — rather it is kept in the memory. For the permanent NIS setting, another supposed file must be manually edited, and by reading that file during the startup, the system learns about NIS and keeps it in the memory. This is the case on Linux, and the mention file is etcsysconfignetwork — entry DOMAINNAME. Unfortunately, these files or entries are misinterpreted as the DNS domain name; sometimes administrators make the mistake and even try to set DNS in that way. It only confuses the system, which now recognizes itself as an NIS client in a not−existing NIS domain. Remember, in DNS there is no an explicit location for the DNS domain name; this is indirectly specified within the etcresolv.conf file directive domain or search.

17.2.5 DatabasesNIS Maps