YP_MKDB(8)

NAME
yp_mkdb - generate the NIS databases

SYNOPSIS
yp_mkdb -c
yp_mkdb -u dbname
yp_mkdb [-c] [-b] [-s] [-i inputfile] [-o outputfile] [-m mastername] inputfile dbname

DESCRIPTION
yp_mkdb creates db(3) style databases for use with FreeBSD's NIS server. yp_mkdb reads data from inputfile, and writes it to dbname in db(3) format (using the hash table method). The input should be in 'key data' format, which is to say two fields of ASCII data separated by white space. The first field is assumed to be the key, and everything else is assumed to be the data. These databases are typically stored in /var/yp/[domainname] where domainname is the name of the NIS domain being served. yp_mkdb is usually invoked by /var/yp/Makefile. yp_mkdb can also be used to dump an NIS database file so that its contents can be examined. For security reasons, all databases that yp_mkdb creates are readable and writable by owner only (and usually the owner is root).

OPTIONS
The yp_mkdb command supports the following flags and options:

-c  Causes yp_mkdb to send a YPPROC_CLEAR request to ypserv(8) on the local host. This signal tells the server to close any open database descriptors and flush out its database cache. If used alone, this flag signals the server and does nothing else. If used as part of a database creation command, yp_mkdb will send the signal only after the new database has been successfully created.

-b  This flag causes yp_mkdb to add a special entry to the database with a key of YP_INTERDOMAIN and an empty data field. If this key is present in a map, it alters the behavior of the 'match' procedure in ypserv(8) slightly. If a match query fails (because the server couldn't find a record that matched the supplied key), and the YP_INTERDOMAIN key exists within the queried map, ypserv(8) will try to match the entry again using a DNS lookup. Note that this special behavior only applies to the hosts maps. Using the -b flag for other maps has no effect.

-s  This flag is used to add a special entry to the database with a key of YP_SECURE and an empty data field. If this key is present in a map, ypserv(8) will deny access to the map to any client that is not using a reserved port for its query. This is used mainly for the master.passwd maps, which should be restricted to privileged access only.

-u dbname

    Dump (or 'unwind') an NIS database. This option can be used to inspect the contents of an existing NIS database.

[-i inputfile]

    When generating an NIS map, encode inputfile as a special entry in the database with a key of YP_INPUT_FILE.

[-o outputfile]

    When generating an NIS map, encode outputfile as a special entry in the database with a key of YP_OUTPUT_FILE.

[-m mastername]

    When generating an NIS map encode mastername as a special entry in the database with a key of YP_MASTER_NAME. This entry in the database is frequently used by various NIS utilities to determine the name of an NIS master server for a domain. By default, yp_mkdb assumes that the local host is the NIS master; the m option is used to override this default.

FILES
/var/yp/Makefile
    The Makefile that calls yp_mkdb to build the NIS databases.

SEE ALSO
db(3), ypserv(8)

AUTHOR
Bill Paul <wpaul@ctr.columbia.edu>