Working With Oracle® Solaris 11.2 Directory and Naming Services: DNS and NIS

Exit Print View

Updated: July 2014
 
 

How to Set Up the Master Server

The ypinit script sets up the master server and the slave servers and clients to use NIS. It also initially runs the make command to create the maps on the master server.

To use the ypinit command to build a fresh set of NIS maps on the master server, complete the following procedure.

  1. Become an administrator on the NIS master server.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Edit the /etc/inet/hosts file.

    Add the host name and IP address of each NIS server. Use the following format: IPaddress FQDN-hostname aliases.

    For example:

    172.16.0.1	master.example.com master
    172.16.0.2	slave1.example.com slave1
    172.16.0.3	slave2.example.com slave2
  3. Build new maps on the master server.
    # /usr/sbin/ypinit –m
  4. Type the names of the NIS servers.

    When ypinit prompts for a list of other machines to become NIS slave servers, type the name of the server you are working on, along with the names of the NIS slave servers that you specified in the /etc/inet/hosts file.

  5. Verify that the NIS domain name is set.
    # domainname
    example.com
  6. Type y to select to stop the process if a nonfatal error occurs.

    When ypinit asks whether you want the procedure to terminate at the first nonfatal error or continue despite nonfatal errors, type y. When you choose y, ypinit exits upon encountering the first problem. You can then fix it and restart ypinit. This is recommended if you are running ypinit for the first time. If you prefer to continue, you can try to manually fix all problems that occur, and then restart ypinit.


    Note -  A nonfatal error can appear when some of the map files are not present. This is not an error that affects the functioning of NIS. You might need to add maps manually if they were not created automatically. Refer to Default NIS Maps for a description of all default NIS maps.
  7. Choose if the source files should be deleted.

    The ypinit command asks whether the existing files in the /var/yp/domain-name directory can be destroyed. This message is displayed only if NIS has been previously installed. Normally, you would choose to delete the source files if you want to clean up the files from a previous installation.

  8. After the ypinit command has constructed the list of servers, it invokes the make command.

    This program uses the instructions contained in the Makefile (either the default file or the one you modified) located in /var/yp. The make command cleans any remaining comment lines from the files that you designated. It also runs makedbm on the files, creating the appropriate maps and establishing the name of the master server for each map.

    If the map or maps being pushed by the Makefile correspond to a domain other than the one returned by the domainname command on the master, you can make sure that they are pushed to the correct domain by starting make in the ypinit shell script with a proper identification of the variable DOM, as follows:

    # make DOM=domain-name passwd

    This command pushes the passwd map to the intended domain, instead of the domain to which the master belongs.

  9. If needed, make changes to the name service switch.

    See Configuring the Name Service Switch.