---
name: "yp_mkdb"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/yp_mkdb"
---

# yp\_mkdb(8)

generate the NIS databases

## NAME

**yp\_mkdb** – generate the NIS databases

## SYNOPSIS

**yp\_mkdb** **-c**

**yp\_mkdb** **-u** *dbname*

**yp\_mkdb** \[**-c**\] \[**-b**\] \[**-s**\] \[**-f**\] \[**-i** *inputfile*\] \[**-o** *outputfile*\] \[**-d** *domainname*\] \[**-m** *mastername*\] *inputfile* *dbname*

## DESCRIPTION

The **yp\_mkdb** utility creates [db(3)](/db/3.md) style databases for use with FreeBSD's NIS server. The **yp\_mkdb** utility reads data from *inputfile*, and writes it to *dbname* in [db(3)](/db/3.md) 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. The **yp\_mkdb** utility is usually invoked by */var/yp/Makefile*. The **yp\_mkdb** utility 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).

The following options are available:

- **-c**

  Cause **yp\_mkdb** to send a YPPROC\_CLEAR request to [ypserv(8)](/ypserv/8.md) 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**

  Cause **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)](/ypserv/8.md) slightly. If a match query fails (because the server could not find a record that matched the supplied key), and the *YP\_INTERDOMAIN* key exists within the queried map, [ypserv(8)](/ypserv/8.md) 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)](/ypserv/8.md) 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.

- **-f**

  This flag is used to turn on filtering of lines in the source file input that start with \`\`+'' or \`\`-'' characters. These characters have special meaning for the *group*, *passwd* and *master.passwd* maps and hence should not be allowed to appear in them as the first character of a key or datum. If the **-f** flag is used, **yp\_mkdb** will reject any source line that starts with a \`\`+'' or \`\`-'' character and issue a warning message displaying the line that was dropped.

- **-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*.

- **-d** *domainname*

  When generating an NIS map, encode *domainname* as a special entry in the database with a key of *YP\_DOMAIN\_NAME*.

- **-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)](/db/3.md), [ypserv(8)](/ypserv/8.md)

## AUTHORS

Bill Paul ⟨*wpaul@ctr.columbia.edu*⟩
