This chapter describes how to administer NIS.
See Chapter 18, Network Information Service (NIS), for a general description of NIS.
See Solaris Naming Setup and Configuration Guide for information on how to initially set up and configure NIS.
For security reasons:
It is best to limit access to the NIS maps on the master server.
The files used to build the NIS password maps should not contain an entry for root to protect against unauthorized access. To accomplish this, the password files used to build the password maps should have the root entry removed from them and be located in a directory other than the master server's /etc directory. This directory should be secured against unauthorized access.
For example, the master server password input files could be stored in a directory such as /var/yp, or any directory of your choice, as long as the file itself is not a link to another file and is specified in the Makefile. The /usr/lib/netsvc/yp/ypstart script automatically sets the correct directory option according to the configuration specified in your Makefile.
In addition to the older Solaris 1.x version passwd file format, this implementation of NIS accepts the Solaris Release 2 passwd and shadow file formats as input for building the NIS password maps.
This section includes information about setting user passwords, adding new users to an NIS domain, and assigning users to netgroups.
To add a new NIS user:
Log in as root on the master NIS server.
Create the new user's login ID with the useradd command.
For Solaris Release 2 systems, type the following:
# useradd userID |
Where userID is the login ID of the new user. This command creates entries in the /etc/passwd and /etc/shadow files on the master NIS server.
Create the new user's initial password.
To create an initial password that the new user can use to log in, run the passwd command in the form:
# passwd userID |
Where userID is the login ID of the new user. You will be prompted for the password to assign to this user.
This step is necessary because the password entry created by the useradd command is locked, which means that the new user cannot log in. By specifying an initial password, you unlock the entry.
If necessary, copy the new entry into the server's passwd map input files.
If the map source files on your master server are in a directory other than /etc (as they should be), you have to copy and paste the new lines from the /etc/passwd and /etc/shadow files into the passwd map input files on the server. (See "Password Files and Namespace Security" for additional information on this matter.)
For example, if you added the new user baruch, the line from /etc/passwd that you would copy to your passwd input file would look like:
baruch:x:123:10:User baruch:/home/baruch:/bin/csh: |
The line for baruch that you would copy from /etc/shadow would look like:
baruch:W12345GkHic:6445:::::: |
If you are using a Solaris Release 1 passwd file format as input for your NIS maps, you must use a text editor to add the new user to your passwd file, manually.
Make sure that the Makefile correctly specifies the directory where the password input file resides.
If appropriate, delete the new user's entries from /etc/passwd and /etc/shadow input files.
For security reasons, it is not good practice to maintain user entries in the NIS master server /etc/passwd and /etc/shadow files. After copying the entries for the new user to the NIS map source files that are stored in some other directory, use the userdel command on the master server to delete the new user.
For example, to delete the new user baruch from the master server's /etc files, you would enter:
# userdel baruch |
For more information about userdel, see the userdel man page.
After you have updated the passwd input file on the master server, update the passwd maps by running make in the directory containing the source file.
# userdel baruch # cd /var/yp # /usr/ccs/bin/make passwd |
Tell the new user the initial password you have assigned to his or her login ID.
After logging in, the new user can run passwd at any time to establish a different password.
Users run passwd to change their passwords.
% passwd username |
(See "Using Passwords" for a complete description of password matters from the users point of view.)
Before users can change their passwords, you must start the rpc.yppasswdd daemon on the master server to update the password file. The commands for starting the daemon are already present in the /usr/lib/netsvc/yp/ypstart file.
The rpc.yppasswdd daemon is started automatically by ypstart on the master server. Notice that when the -m option is given to rpc.yppasswd, a make is forced in /var/yp immediately following a modification of the file. If you want to avoid having this make take place each time the passwd file is changed, remove the -m option from the rpc.yppasswd command in the ypstart script and control the pushing of the passwd maps through the crontab file.
No arguments should follow the rpc.yppasswd -m command. Although you can edit the ypstart script file to achieve a different action, it is not recommended that you modify this file other than optionally removing the -m option. All commands and daemons invoked by this file with the proper set of command line parameters. If you choose to edit this file, be especially careful when editing the rpc.yppasswdd command. If you add an explicit call to the passwd.adjunct file, the exact $PWDIR/security/passwd.adjunct
path must be used; otherwise, incorrect processing results.
NIS netgroups are groups (sets) of users or machines that you define for your administrative purposes. For example, you can create netgroups that:
Define a set of users who can access a specific machine
Define a set of NFS client machines to be given some specific filesystem access.
Define a set of users who are to have administrator privileges on all the machines in a particular NIS domain.
Each netgroup is given a netgroup name. Netgroups do not directly set permissions or access rights. Instead, the netgroup names are used by other NIS maps in places where a user name or machine name would normally be used. For example, suppose you created a netgroup of network administrators called netadmins. To grant all members of the netadmins group access to a given machine, you need only add a netadmin entry to that machine's /etc/passwd file. Netgroup names can also be added to the /etc/netgroup file and propogated to the NIS netgroup map. See the netgroup man page for more detailed information on using netgroups.
On a network using NIS, the netgroup input file on the master NIS server is used for generating three maps: netgroup, netgroup.byuser, and netgroup.byhost. The netgroup map contains the basic information in the netgroup input file. The two other NIS maps contain information in a format that speeds lookups of netgroup information, given the machine or user.
Entries in the netgroup input file are in the format: name ID, where name is the name you give to a netgroup, and ID identifies a machine and/or user who belongs to the netgroup. You can specify as many ids (members) to a netgroup as you want, separated by commas. For example, to create a netgroup with three members, the netgroup input file entry would be in the format: name ID, ID, ID. The member IDs in a netgroup input file entry are in the format:
([-|machine], [-|user], [domain]) |
Where machine is a machine name, user is a user ID, and domain is the machine or user's NIS domain with each element separated by a comma. The domain element is optional and should only be used to identify machines or users in some other NIS domain. The machine and user element of each member's entry are required, but a dash (-) is used to denote a null. There is no necessary relationship between the machine and user elements in an entry.
For example, below are two sample netgroup input file entries, each of which create a netgroup named admins composed of the users hauri and juanita who is in the remote domain sales and the machines altair and sirius.
admins (altair, hauri), (sirius,juanita,sales) |
admins (altair,-), (sirius,-), (-,hauri), (-,juanita,sales) |
Various programs use the netgroup NIS maps for permission checking during login, remote mount, remote login, and remote shell creation. These programs include: mountd, login, rlogin, and rsh. The login command consults the netgroup maps for user classifications if it encounters netgroup names in the passwd database. The mountd daemon consults the netgroup maps for machine classifications if it encounters netgroup names in the /etc/dfs/dfstab file. rlogin and rsh (in fact, any program that uses the ruserok interface) consults the netgroup maps for both machine and user classifications if they encounter netgroup names in the /etc/hosts.equiv or .rhosts files.
If you add a new NIS user or machine to your network, be sure to add them to appropriate netgroups in the netgroup input file. Then use the make and yppush commands to create the netgroup maps and push them to all of your NIS servers. See the netgroup man page for detailed information on using netgroups and netgroup input file syntax.
The following sections describe how to administer NIS maps.
Users can obtain information from and about the maps at any time by using the ypcat, ypwhich, and ypmatch commands. In the examples that follow, mapname refers both to the official name of a map and to its nickname, if any.
To list all the values in a map, type:
% ypcat mapname |
To list both the keys and the values (if any) in a map, type:
% ypcat -k mapname |
To list all the map nicknames, type any of the following commands:
% ypcat -x |
% ypwhich -x |
% ypmatch -x |
To list all the available maps and their master(s), type:
% ypwhich -m |
To list the master server for a particular map, type:
% ypwhich -m mapname |
To match a key with an entry in a map, type:
% ypmatch key mapname |
If the item you are looking for is not a key in a map, type:
% ypcat mapname | grep item |
Where item is the information you are searching for. To obtain information about other domains, use the -d domainname options of these commands.
If the machine requesting information for a domain other than its default does not have a binding for the requested domain, it causes ypbind to consult the /var/yp/binding/domainname/ypservers file for a list of servers for that domain. If this file doesn't exist it issues an RPC broadcast for a server. In this case, there must be a server for the requested domain on the same subnet as the requesting machine.
To change the master server for a selected map, you first have to build the map on the new NIS master. Since the old master server name occurs as a key-value pair in the existing map (this pair is inserted automatically by makedbm), copying the map to the new master or transferring a copy to the new master with ypxfr is insufficient. You have to reassociate the key with the new master server name. If the map has an ASCII source file, you should copy this file to the new master.
Here are instructions for remaking a sample NIS map called sites.byname.
Log in to the new master as superuser and type:
newmaster# cd /var/yp |
Makefile must have an entry for the new map before you specify the map to make. If this is not the case, edit the Makefile now.
To update or remake the map, type:
newmaster# make sites.byname |
If the old master remains an NIS server, remote log in (rlogin) to the old master and edit Makefile. Comment out the section of the Makefile that made sites.byname so that it is no longer made there.
If sites.byname only exists as an ndbm file, remake it on the new master by disassembling a copy from any NIS server, then running the disassembled version through makedbm:
newmaster# cd /var/yp newmaster# ypcat -k sites.byname | makedbm -domain/sites.byname |
After making the map on the new master, you must send a copy of the new map to the other slave servers. However, do not use yppush, because the other slaves will try to get new copies from the old master, rather than the new one. A typical method for circumventing this is to transfer a copy of the map from the new master back to the old master. To do this, become superuser on the old master server and type:
oldmaster# /usr/lib/netsvc/yp/ypxfr -h newmaster sites.byname |
Now it is safe to run yppush. The remaining slave servers still believe that the old master is the current master. They attempt to get the current version of the map from the old master. When they do so, they will get the new map, which names the new master as the current master.
If this method fails, you can try this cumbersome but sure-fire option: log in as root on each NIS server and execute the ypxfr command shown above.
NIS intelligently parses the setup files. Although this makes NIS administration easier, it does make the behavior of NIS more sensitive to changes in the setup and configuration files.
Use the procedures in this section when modifying any of the following:
Add or delete /etc/resolv.conf to allow or deny DNS forwarding
Add or delete $PWDIR/security/passwd.adjunct to allow or deny C2 security. ($PWDIR
is defined in /var/yp/Makefile.)
To modify any of the listed files:
Stop the NIS server by typing;
# /etc/init.d/yp stop |
Make the necessary changes to your files.
Restart the NIS server by typing:
# /etc/init.d/yp start |
You do not have to stop and start NIS when changing NIS maps or the map source files.
Keep in mind the following points:
Deleting a map or source file from a NIS master server does not automatically result in corresponding deletions from slave servers. You must delete maps and source files from slave servers by hand.
New maps do not automatically get pushed to existing slave servers. You must run ypxfr from the slaves.
You can modify the Makefile provided by default in /var/yp to suit your needs. (Be sure to keep an unmodified copy of the original Makefile for future reference.) You can add or delete maps, and you can change the names of some of the directories.
To add a new NIS map, you must get copies of the ndbm files for the map into the /var/yp/domainname directory on each of the NIS servers in the domain. This is normally done for you by the Makefile. After deciding which NIS server is the master of the map, modify the Makefile on the master server so that you can conveniently rebuild the map. Different servers can be masters of different maps, but in most cases this leads to administrative confusion, and it is strongly recommended that you set only one server as the master of all maps.
Typically a human-readable text file is filtered through awk, sed, or grep to make it suitable for input to makedbm. Refer to the default Makefile for examples. See the make man page for general information about the make command.
Use the mechanisms already in place in the Makefile when deciding how to create dependencies that make will recognize. Be aware that make is very sensitive to the presence or absence of tabs at the beginning of lines within the dependency rules, and a missing tab can invalidate an entry that is otherwise well formed.
To add an entry to the Makefile, do the following:
Add the name of the database to the all rule
Write the time rule
Add the rule for the database
For example, in order for the Makefile to work on automounter input files, you would have to add the auto_direct.time and auto_home.time maps to the NIS database.
To add these maps to the NIS database:
Modify the line that starts with the word all by adding the name(s) of the database you want to add:
all: passwd group hosts ethers networks rpc services protocols \ netgroup bootparams aliases netid netmasks \ auto_direct auto_home auto_direct.time auto_home.time |
The order of the entries is not relevant, but the blank space at the beginning of the continuation lines must be a Tab, not spaces.
Add the following lines at the end of the Makefile:
auto_direct: auto_direct.time auto_home: auto_home.time |
Add an entry for auto_direct.time in the middle of the file.
auto_direct.time: $(DIR)/auto_direct @(while read L; do echo $$L; done < $(DIR)/auto_direct $(CHKPIPE)) | \ (sed -e "/^#/d" -e "s/#.*$$//" -e "/^ *$$/d" $(CHKPIPE)) | \ $(MAKEDBM) - $(YPDBDIR)/$(DOM)/auto_direct; @touch auto_direct.time; @echo "updated auto_direct"; @if [ ! $(NOPUSH) ]; then $(YPPUSH) auto_direct; fi @if [ ! $(NOPUSH) ]; then echo "pushed auto_direct"; fi |
Where:
CHKPIPE makes certain that the operations to the left of the pipe (|) are successfully completed before piping the results to next commands. If the operations to the left of the pipe do not successfully complete, the process is terminated with a "NIS make terminated" message.
NOPUSH prevents the makefile from calling yppush to transfer the new map to the slave servers. If NOPUSH is not set, the push is done automatically.
The while loop at the beginning is designed to eliminate any backslash-extended lines in the input file. The sed script eliminates comment and empty lines, and feeds the output to
The same procedure should be followed for all other automounter maps such as auto_home, or any other nondefault maps.
# make name |
Where name is the name of the map you want to make. For example, auto_direct.
If you do not want the Makefile to produce maps for a specific database, edit the Makefile as follows:
Delete the name of the database from the all rule.
Delete or comment out the database rule for the database you want to delete.
For example, to delete the hosts database, the hosts.time entry should be removed.
Remove the time rule.
For example, to delete the hosts database, the hosts: hosts.time entry should be removed.
Remove the map from the master and slave servers.
You can change the settings of the variables defined at the top of the Makefile simply by changing the value to the right of the equal sign (=). For instance, if you do not want to use the files located in /etc as input for the maps, but you would rather use files located in another directory, such as /var/etc/domainname, you should change the value of DIR
from DIR=/etc to DIR=/var/etc/domainname. You may also change the value of PWDIR from PWDIR=/etc to PWDIR=/var/etc/domainname.
The variables are:
DIR= The directory containing all of the NIS input files except passwd and shadow. The default value is /etc. Since it is not good practice to use the files in the master server's /etc directory as NIS input files, you should change this value.
PWDIR= The directory containing the passwd and shadow NIS input files. Since it is not good practice to use the files in the master server's /etc directory as NIS input files, you should change this value.
DOM= The NIS domain name. The default value of DOM is set using the domainname command. Remember that most NIS commands use the current machine's domain which is set in the machine's /etc/defaultdomain file.
After you have installed NIS, you might discover that some maps require frequent updating while others never need to change. For example, the passwd.byname map can change frequently on a large company's network. On the other hand, the auto_master map changes little, if at all.
When you need to update a map, you can use one of two updating procedures, depending on whether it is a default map or not.
A default map is a map in the default set created by ypinit from the network databases.
Nondefault maps can be any of the following:
Maps included with an application purchased from a vendor
Maps created specifically for your site
Maps created from a nontext file
The following sections explain how to use various updating tools. In practice, you might decide to only use them if you add nondefault maps or change the set of NIS servers after the system is already up and running.
Use the following procedure for updating maps supplied with the default set.
Become root on the master server.
Always modify NIS maps only on the master server.
Edit the source file for the map you want to change, whether that file resides in /etc or in some other directory of your choice.
Type the following:
# cd /var/yp# make mapname |
The make command then updates your map according to the changes you made in its corresponding file. It also propagates the changes among the other servers.
To update a nondefault map, you must:
Create or edit its corresponding text file.
Build (or rebuild) the new or updated map. There are two ways to build a map:
Use the Makefile. Using the Makefile is the preferred method of building a non-default map. If the map has an entry in the Makefile, simply run make name where name is the name of map you want to build. If the map does not have a Makefile entry, try to create one following the instructions in "Modifying and Using the Makefile".
Use the /usr/sbin/makedbm program. (The makedbm man page fully describes this command.)
There are two different methods for using makedbm to modify maps if you do not have an input file:
Redirect the makedbm -u output to a temporary file, modify the file, then use the modified file as input to makedbm.
Have the output of makedbm -u operated on within a pipeline that feeds into makedbm. This is appropriate if you can update the disassembled map with either awk, sed, or a cat append.
To create new maps, you can use one of two possible procedures: the first method uses an existing text file as input; the second uses standard input.
Assume that a text file /var/yp/mymap.asc was created with an editor or a shell script on the master. You want to create an NIS map from this file and locate it in the homedomain subdirectory. To do this, type the following on the master server:
# cd /var/yp # makedbm mymap.asc homedomain/mymap |
The mymap map now exists on the master server in the directory homedomain. To distribute the new map to slave servers run ypxfr.
Adding entries to mymap is simple. First, you must modify the text file /var/yp/mymap.asc. (If you modify the actual dbm files without modifying the corresponding text file, the modifications are lost.) Then run makedbm as shown above.
When no original text file exists, create the NIS map from the keyboard by typing input to makedbm, as shown below (end with Control-D):
ypmaster# cd /var/yp ypmaster# makedbm - homedomain/mymapkey1 value1 key2 value2 key3 value3 ypmaster# |
If you later need to modify the map, you can use makedbm to disassemble the map and create a temporary text intermediate file. To disassemble the map and create a temporary file, type the following:
% cd /var/yp % makedbm -u homedomain/mymap > mymap.temp |
The resulting temporary file mymap.temp has one entry per line. You can edit this file as needed, using any text editor.
To update the map, give the name of the modified temporary file to makedbm by typing the following:
% makedbm mymap.temp homedomain/mymap % rm mymap.temp |
Then propagate the map to the slave servers, by becoming root and typing:
# yppush mymap |
The preceding paragraphs explained how to use makedbm to create maps; however, almost everything you actually have to do can be done by ypinit and Makefile unless you add nondefault maps to the database or change the set of NIS servers after the system is already up and running.
Whether you use the Makefile in /var/yp or some other procedure the goal is the same: a new pair of well-formed dbm files must end up in the maps directory on the master server.
After a map is changed, the Makefile uses yppush to propagate a new map to the slave servers (unless NOPUSH
is set in the Makefile). It does this by informing the ypserv daemon and sending a map transfer request. The ypserv daemon on the slave then starts a ypxfr process, which in turn contacts the ypxfrd daemon on the master server. Some basic checks are made (for example did the map really change?) and then the map is transferred. ypxfr on the slave then sends a response to the yppush process indicating whether the transfer succeeded.
The above procedure will not work for newly created maps that do not yet exist on the slave servers. New maps must be sent to the slave servers by running ypxfr on the slaves.
Occasionally, maps fail to propagate and you must to use ypxfr manually to send new map information. You can choose to use ypxfr in two different ways: periodically through the root crontab file, or interactively on the command line. These approaches are discussed in the following sections.
Maps have different rates of change. For instance, some might not change for months at a time, such as protocols.byname among the default maps and auto_master among the nondefault maps; but passwd.byname can change several times a day. Scheduling map transfer using the crontab command allows you to set specific propagation times for individual maps.
To periodically run ypxfr at a rate appropriate for the map, the root crontab file on each slave server should contain the appropriate ypxfr entries. ypxfr contacts the master server and transfers the map only if the copy on the master server is more recent than the local copy.
If your master server runs rpc.yppasswdd with the default -m option, then each time someone changes their yp password, the passwd daemon runs make, which rebuilds the passwd maps.
As an alternative to creating separate crontab entries for each map, you might prefer to have the root crontab command run a shell script that periodically updates all maps. Sample map-updating shell scripts are n the /usr/lib/netsvc/yp directory. The script names are ypxfr_1perday, ypxfr_1perhour, and ypxfr_2perday. You can modify or replace these shell scripts to fit your site requirements. Example 19-1 shows the default ypxfr_1perday shell script.
#! /bin/sh # # ypxfr_1perday.sh - Do daily yp map check/updates PATH=/bin:/usr/bin:/usr/lib/netsvc/yp:$PATH export PATH # set -xv ypxfr group.byname ypxfr group.bygid ypxfr protocols.byname ypxfr protocols.bynumber ypxfr networks.byname ypxfr networks.byaddr ypxfr services.byname ypxfr ypservers |
This shell script updates the maps once per day, if the root crontab is executed daily. You can also have scripts that update maps once a week, once a month, once every hour, and so forth, but be aware of the performance degradation implied in frequently propagating the maps.
Run the same shell scripts as root on each slave server configured for the NIS domain. Alter the exact time of execution from one server to another to avoid bogging down the master.
If you want to transfer the map from a particular slave server, use the -h machine option of ypxfr within the shell script. Here is the syntax of the commands you put in the script:
/usr/lib/netsvc/yp/ypxfr -h machine [ -c ] mapname |
Where machine is the name of the server with the maps you want to transfer, and mapname is the name of the requested map. If you use the -h option without specifying a machine, ypxfr tries to get the map from the master server. If ypserv is not running locally at the time ypxfr is executed, you must use the -c flag so that ypxfr does not send a clear current map request to the local ypserver.
You can use the -s domain option to transfer maps from another domain to your local domain. These maps should be the same across domains. For example, two domains might share the same services.byname and services.byaddr maps. Alternatively, you can use rcp, or rdist for more control, to transfer files across domains.
The second method of invoking ypxfr is to run it as a command. Typically, you do this only in exceptional situations--for example, when setting up a temporary NIS server to create a test environment or when trying to quickly get an NIS server that has been out of service consistent with the other servers.
The transfer attempts and results of ypxfr can be captured in a log file. If a file called /var/yp/ypxfr.log exists, results are appended to it. No attempt to limit the size of the log file is made. To prevent it from growing indefinitely, empty it from time to time by typing:
# cd /var/yp # cp ypxfr.log ypxfr.log.old # cat /dev/null > /var/yp/ypxfr.log |
You can have crontab execute these commands once a week. To turn off logging, remove the log file.
After NIS is running, you may need to create a new NIS slave server that you did not include in the initial list given to ypinit.
To add a new NIS server:
Log in to the master server as root.
Change to the NIS domain directory by typing:
# cd /var/yp/domainname |
Disassemble the ypservers file, as follows:
# makedbm -u ypservers >/tmp/temp_file |
The makedbm command converts ypservers from ndbm format to a temporary ASCII file /tmp/temp_file.
Edit the /tmp/temp_file file using a text editor. Add the name of the new slave server to the list of servers. Then save and close the file.
Run the makedbm command with temp_file as the input file and ypservers as the output file:
# makedbm /tmp/temp_file ypservers |
makedbm then converts ypservers back into ndbm format.
Verify that the ypservers map is correct (since there is no ASCII file for ypservers) by typing:
slave3# makedbm -u ypservers |
The makedbm command displays each entry in ypservers on your screen.
If a machine name is not in ypservers, it will not receive updates to the map files because yppush consults this map for the list of slave servers.
Set up the new slave server's NIS domain directory by copying the NIS map set from the master server.
To do this, log in to the new NIS slave as superuser and run the ypinit and ypbind commands:
slave3# cd /var/yp slave3# ypinit -c list of servers slave3# /usr/lib/netsvc/yp/ypbind |
To initialize this machine as a slave, type the following:
# /usr/sbin/ypinit -s ypmaster |
Where ypmaster is the machine name of the existing NIS master server.
Run ypstop to stop the machine running as a NIS client.
#/usr/lib/netsvc/up/ypstop |
Run ypstart to start NIS slave service.
#/usr/lib/netsvc/up/ypstart |
See the Solaris Naming Setup and Configuration Guide for a more detailed description of setting up NIS slave servers.
If the $PWDIR/security/passwd.adjunct file is present, C2 security is started automatically. ($PWDIR
is defined in /var/yp/Makefile.) The C2 security mode uses the passwd.adjunct file to create the passwd.adjunct NIS map. In this implementation, NIS allows you to use both the passwd.adjunct file and shadow file to manage security. The passwd.adjunct file is processed only when you type:
# make passwd.adjunct |
The make passwd command processes the passwd map only, not the passwd.adjunct map when you run make manually in the C2 security mode.
To change the NIS domain name of a machine:
Edit the machine's /etc/defaultdomain file, exchanging its present contents with the new domain name for the machine.
For example, if the current domain name is sales.doc.com, you might change it to research.doc.com.
Run domainname `cat /etc/defaultdomain'
Set the machine up as a NIS client, slave, or master server.
See Solaris Naming Setup and Configuration Guide for details.
Typically, NIS clients are configured with the nsswitch.conf file to use only NIS for machine name and address lookups. If this type of lookup fails, an NIS server can forward these lookups to DNS.
To configure machine name and address lookup to occur through NIS and then through DNS:
The two maps hosts.byname and hosts.byaddr must have the YP_INTERDOMAIN key in them; to set this key, edit the Makefile and modify the lines (at the top of the file) from:
#B=-b B= |
to:
B=-b #B= |
This tells makedbm to start with the -b flag when making the maps, and the YP_INTERDOMAIN key will be inserted into the ndbm files.
Run make to rebuild that maps.
# /usr/ccs/bin/make hosts |
Make sure that all NIS servers have an /etc/resolv.conf file that points to valid name server(s).
To enable DNS forwarding, stop each server with the ypstop command
# /usr/lib/netsvc/yp/ypstop |
Restart each server with the ypstart command:
# /usr/lib/netsvc/yp/ypstart |
In this implementation of NIS, if a /etc/resolve.conf file exists on the server, ypstart automatically starts the ypserv daemon with the -d option to forward requests to DNS.
If you have NIS servers that are not running the Solaris Release 2, then you must make sure that the YP_INTERDOMAIN key is present in the host maps for DNS to be consulted.
Most of the preceding information assumes that both master and slave servers in the NIS domain are running the Solaris Release 2. If that is not the case, problems may arise. Table 19-1 summarizes how to successfully avoid problems in mixed NIS domains. The notation "4.0.3+" means "release 4.0.3 of the SunOS operating environment or later." The command makedbm -b is a reference to the "-B" variable in the Makefile.
Table 19-1 NIS/DNS in Heterogeneous NIS Domains
SLAVE |
MASTER |
||
---|---|---|---|
|
4.0.3+ |
Solaris NIS |
|
4.0.3+ |
Master: makedbm -b Slave: ypxfr |
Master: makedbm -b Slave: ypxfr -b |
Master: ypserv -d Slave: ypxfr -b |
Solaris NIS |
Master: makedbm -b Slave: ypxfr |
Master: makedbm -b Slave: ypxfr |
Master: ypserv -d Slave: ypxfr with resolve.conf or ypxfr -b |
If ypserv on the master is disabled, you can no longer update any of the NIS maps. If you choose to turn off NIS on a network currently running it, you can disable NIS after the next reboot by simply renaming the ypbind file to ypbind.orig, as follows:
% mv /usr/lib/netsvc/yp/ypbind /usr/lib/netsvc/yp/ypbind.orig |
To disable NIS after the next reboot on a particular NIS slave or master, type the following on the server in question:
% mv /usr/lib/netsvc/yp/ypserv /usr/lib/netsvc/yp/ypserv.orig |
To stop NIS immediately, type:
% /usr/lib/netsvc/yp/ypstop |
The NIS service is automatically restarted after the next reboot unless the ypbind and ypserv files are renamed as described above.
See "NIS Problems and Solutions" and "NIS+ and NIS Compatibility Problems" for problem solving information.
See Appendix B, Error Messages, for an alphabetic list of the more common namespace error messages and their meanings.