Solaris Naming Administration Guide

Using NIS in Conjunction With DNS

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:

  1. 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:




    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.

  2. Run make to rebuild that maps.

    # /usr/ccs/bin/make hosts
  3. Make sure that all NIS servers have an /etc/resolv.conf file that points to valid name server(s).

  4. To enable DNS forwarding, stop each server with the ypstop command

    # /usr/lib/netsvc/yp/ypstop
  5. 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.

    Note -

    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.

Problems in Mixed NIS Domains

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





Solaris NIS 


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