---
name: "netgroup_mkdb"
section: "8"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/netgroup_mkdb"
---

# netgroup\_mkdb(8)

generate the netgroup databases

## NAME

**netgroup\_mkdb** – generate the netgroup databases

## SYNOPSIS

**netgroup\_mkdb** \[**-o** *database*\] \[*file*\]

## DESCRIPTION

**netgroup\_mkdb** creates Berkeley databases for the specified *file*. If no file is specified, */etc/netgroup* is used. These databases are then installed into */etc/netgroup.db*. The file must be in the correct format (see [netgroup(5)](/netgroup/5.md)).

The options are as follows:

- **-o** *database*

  Put the output databases in the named file.

The databases are used by the C library netgroup routines (see [getnetgrent(3)](/getnetgrent/3.md)).

## FILES

- */etc/netgroup.db*

  current netgroup database

- */etc/netgroup.db.tmp*

  a temporary file

- */etc/netgroup*

  current netgroup file

## EXIT STATUS

The **netgroup\_mkdb** utility exits 0 on success, and \>0 if an error occurs.

## SEE ALSO

[dbopen(3)](/dbopen/3.md), [getnetgrent(3)](/getnetgrent/3.md), [netgroup(5)](/netgroup/5.md)

## BUGS

Because **netgroup\_mkdb** guarantees not to install a partial destination file, it must build a temporary file in the same file system and if successful use [rename(2)](/rename/2.md) to install over the destination file.

If **netgroup\_mkdb** fails, it will leave the previous version of the destination file intact.
