System Administration Guide: Naming and Directory Services (NIS+)

NIS+ Cold-Start File and Directory Cache

When a client is initialized, it is given a cold-start file. The cold-start file gives a client a copy of a directory object that it can use as a starting point for contacting servers in the namespace. The directory object contains the address, public keys, and other information about the master and replica servers that support the directory. Normally, the cold-start file contains the directory object of the client's home domain.

A cold-start file is used only to initialize a client's local directory cache. The directory cache is managed by an NIS+ facility called the cache manager. The cache manager stores the directory objects that enable a client to send its requests to the proper servers. The information obtained from the client's cold-start file is downloaded into a file named NIS_SHARED_DIRCACHE in /var/nis.

Illustration shows cold-start file initializing client's
directory cache

By storing a copy of the namespace's directory objects in its directory cache, a client can know which servers support which domains. (To view the contents of a client's cache, use the nisshowcache command, described in nisshowcache Command.) Here is a simplified example:

Domain Name and Directory Name are the same 

Supporting Server 

IP Address 

doc.com.

rootmaster 

172.29.6.77 

sales.doc.com.

salesmaster 

172.29.6.66 

manf.doc.com.

manfmaster 

172.29.6.37 

int.sales.doc.com.

Intlsalesmaster 

10.22.3.7 

To keep these copies up-to-date, each directory object has a time-to-live (TTL) field. Its default value is 12 hours. If a client looks in its directory cache for a directory object and finds that it has not been updated in the last 12 hours, the cache manager obtains a new copy of the object. You can change a directory object's time-to-live value with the nischttl command, as described in nischttl Command. However, keep in mind that the longer the time-to-live, the higher the likelihood that the copy of the object will be out of date; and the shorter the time to live, the greater the network traffic and server load.

How does the directory cache accumulate these directory objects? As mentioned above, the cold-start file provides the first entry in the cache. Therefore, when the client sends its first request, the request goes to the server specified by the cold-start file. If the request is for access to the domain supported by that server, the server answers the request.

Illustration shows client accessing server specified
by cold-start file

If the request is for access to another domain (for example, sales.doc.com.), the server tries to help the client locate the proper server. If the server has an entry for that domain in its own directory cache, it sends a copy of the domain's directory object to the client. The client loads that information into its directory cache for future reference and sends its request to that server.

Illustration shows server sending copy of directory object
to its own domainIllustration shows server sending copy of directory object
to its own domain

In the unlikely event that the server does not have a copy of the directory object the client is trying to access, it sends the client a copy of the directory object for its own home domain, which lists the address of the server's parent. The client repeats the process with the parent server, and keeps trying until it finds the proper server or until it has tried all the servers in the namespace. What the client does after trying all the servers in the domain is determined by the instructions in its name service switch configuration file.

Over time, the client accumulates in its cache a copy of all the directory objects in the namespace and thus the IP addresses of the servers that support them. When it needs to send a request for access to another domain, it can usually find the name of its server in its directory cache and send the request directly to that server.