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

# mknetid(8)

generate a YP map of group and domain memberships

## NAME

**mknetid** – generate a YP map of group and domain memberships

## SYNOPSIS

**mknetid** \[**-q**\] \[**-d** *domain*\] \[**-g** *groupfile*\] \[**-h** *hostfile*\] \[**-m** *netidfile*\] \[**-P** *master.passwdfile*\] \[**-p** *passwdfile*\]

## DESCRIPTION

The **mknetid** utility combines information from the [passwd(5)](/passwd/5.md), [group(5)](/group/5.md), [hosts(5)](/hosts/5.md), and [netid(5)](/netid/5.md) files, printing it in [netid(5)](/netid/5.md) format to the standard output. If the [passwd(5)](/passwd/5.md) file is not available, the [master.passwd(5)](/master.passwd/5.md) file is used instead. The [netid(5)](/netid/5.md) file is optional and does not need to exist.

The most common application is to pass the output to [makedbm(8)](/makedbm/8.md) in order to create a *netid.byname* map for the [yp(8)](/yp/8.md) subsystem.

The options are as follows:

- **-d** *domain*

  Use *domain* instead of the default [domainname(1)](/domainname/1.md).

- **-g** *groupfile*

  Use *groupfile* instead of */etc/group*.

- **-h** *hostfile*

  Use *hostfile* instead of */etc/hosts*.

- **-m** *netidfile*

  Use *netidfile* instead of */etc/netid*.

- **-P** *master.passwdfile*

  Use *master.passwdfile* instead of */etc/master.passwd*.

- **-p** *passwdfile*

  Use *passwdfile* instead of */etc/passwd*.

- **-q**

  Keep quiet about multiple occurrences of a user ID. Ignore all but the first.

## FILES

- */etc/passwd*

  - */etc/master.passwd*

  - */etc/group*

  - */etc/hosts*

  - */etc/netid*

  ## SEE ALSO

[domainname(1)](/domainname/1.md), [group(5)](/group/5.md), [hosts(5)](/hosts/5.md), [netid(5)](/netid/5.md), [passwd(5)](/passwd/5.md), [Makefile.yp(8)](/Makefile.yp/8.md)

## AUTHORS

Mats O Jansson ⟨*moj@stacken.kth.se*⟩
