---
name: "Makefile.yp"
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/Makefile.yp"
---

# Makefile.yp(8)

generate and distribute YP maps

## NAME

**Makefile.yp** – generate and distribute YP maps

## SYNOPSIS

cd /var/yp; make

## DESCRIPTION

The **Makefile.yp** utility generates or updates the YP maps to be served by [ypserv(8)](/ypserv/8.md).

Each YP domain to be served must have its own subdirectory below */var/yp*. Use [ypinit(8)](/ypinit/8.md) to set up such subdirectories. In particular, [ypinit(8)](/ypinit/8.md) will copy */var/yp/Makefile.yp* into each new domain subdirectory. For common configuration changes affecting all future domains, edit */var/yp/Makefile.yp* before running [ypinit(8)](/ypinit/8.md). For configuration changes affecting only one individual domain, edit the *Makefile* in the respective domain subdirectory after running [ypinit(8)](/ypinit/8.md). Do *not* edit */var/yp/Makefile.yp.dist*.

By default, input data for generating YP maps is collected from the */etc* directory. Edit the DIR variable to choose a different source directory.

To regenerate all maps for all domains, run [make(1)](/make/1.md) in */var/yp*. To regenerate all maps for one single domain, run [make(1)](/make/1.md) in the respective domain subdirectory. The [makedbm(8)](/makedbm/8.md) utility will be used to create the maps in Berkeley DB format, and they will be stored inside the appropriate domain subdirectory.

Whenever a YP map has been updated, it is automatically distributed to all slave servers in the respective domain using the [yppush(8)](/yppush/8.md) utility. To disable automatic distribution, set the NOPUSH variable to an arbitrary, non-empty, value.

## STANDARD YP MAPS

By default, **Makefile.yp** provides the following [make(1)](/make/1.md) targets:

- **passwd**

  Generates the *passwd.byname*, *passwd.byuid*, *master.passwd.byname*, and *master.passwd.byuid* maps from [master.passwd(5)](/master.passwd/5.md) for use by [getpwent(3)](/getpwent/3.md).

  The *master.passwd.\** maps always contain complete records in [master.passwd(5)](/master.passwd/5.md) format, including the encrypted passwords.

  The *passwd.\** maps follow the reduced [passwd(5)](/passwd/5.md) format having the class, change, and expire fields removed but by default the encrypted passwords are included too. If the UNSECURE variable is changed to be empty, the encrypted passwords are replaced by asterisks (‘\*’). This “secure” mode is compatible with OpenBSD and FreeBSD clients.

  The MINUID and MAXUID variables restrict the range of user IDs included into the four passwd maps. By default, system users are not included.

- **netgroup**

  Generates the *netgroup*, *netgroup.byuser*, and *netgroup.byhost* maps from [netgroup(5)](/netgroup/5.md) for use by [getnetgrent(3)](/getnetgrent/3.md) and [passwd(5)](/passwd/5.md). Requires the [revnetgroup(8)](/revnetgroup/8.md) utility.

- **group**

  Generates the *group.byname* and *group.bygid* maps from [group(5)](/group/5.md) for use by [getgrent(3)](/getgrent/3.md).

  The MINGID and MAXGID variables restrict the range of group IDs included into both group maps. By default, system groups are not included.

- **netid**

  Generates the *netid.byname* map from [netid(5)](/netid/5.md), [passwd(5)](/passwd/5.md), [group(5)](/group/5.md), and [hosts(5)](/hosts/5.md) for use by [getgrouplist(3)](/getgrouplist/3.md). Falls back to [master.passwd(5)](/master.passwd/5.md) in case [passwd(5)](/passwd/5.md) is not available. Requires the [mknetid(8)](/mknetid/8.md) utility.

- **hosts**

  Generates the *hosts.byname* and *hosts.byaddr* maps from [hosts(5)](/hosts/5.md) for use by [gethostbyname(3)](/gethostbyname/3.md).

  To get [ypserv(8)](/ypserv/8.md) to ask DNS for unknown hosts, set the USEDNS variable to **-b**.

- **ethers**

  Generates the *ethers.byaddr* and *ethers.byname* maps from [ethers(5)](/ethers/5.md) for use by [ether\_aton(3)](/ether_aton/3.md).

- **rpc**

  Generates the *rpc.bynumber* map from [rpc(5)](/rpc/5.md) for use by [getrpcent(3)](/getrpcent/3.md).

- **services**

  Generates the *services.byname* map from [services(5)](/services/5.md) for use by [getservent(3)](/getservent/3.md).

- **protocols**

  Generates the *protocols.byname* and *protocols.bynumber* maps from [protocols(5)](/protocols/5.md) for use by [getprotoent(3)](/getprotoent/3.md).

- **aliases**

  Generates the *mail.aliases* and *mail.byaddr* maps from [aliases(5)](/aliases/5.md). This target uses both [sendmail(8)](/sendmail/8.md) with the option **-bi** and the [mkalias(8)](/mkalias/8.md) utility.

- **amd.home**

  Generates the *amd.home* map from the file */etc/amd/amd.home*.

- **all**

  Generates all of the above, and sends a hangup signal to [ypserv(8)](/ypserv/8.md) such that it uses the new maps.

In order to keep additional custom YP maps up to date, the *Makefile* should be extended to support additional targets.

## FILES

- /var/yp/Makefile

  Top level YP Makefile.

- /var/yp/*domainname*/Makefile

  Per domain YP maps Makefile.

- /var/yp/*domainname*/ypservers.db

  Database of hosts serving this domain.

- /var/yp/*domainname/mapname*.db

  Database files containing the YP maps.

- /var/yp/*domainname/target*.time

  Cookies controlling the operation of [make(1)](/make/1.md).

## SEE ALSO

[make(1)](/make/1.md), [dbopen(3)](/dbopen/3.md), [makedbm(8)](/makedbm/8.md), [yp(8)](/yp/8.md), [ypinit(8)](/ypinit/8.md), [yppush(8)](/yppush/8.md), [ypserv(8)](/ypserv/8.md)

## BUGS

When NOPUSH is set and individual maps are regenerated (as opposed to **all**), the hangup signal to [ypserv(8)](/ypserv/8.md) must be sent manually, or the new maps won't be used.

When NOPUSH is unset, maps are pushed to the master server on the local host too, slowing down **Makefile.yp**.
