Mail Administration Guide

Setting Up NIS mail.aliases Map

The /etc/mail/aliases file on an NIS master contains all names by which a system or person is known. The NIS master is searched if there is no match in the local /etc/mail/aliases files. The sendmail program uses the NIS master file to determine mailing addresses. See the aliases(4) man page.

You can either edit the file on each system or edit the file on one system and copy it to each of the other systems.

Aliases are in the following form:


name: name1, name2, ...

You can use aliases for local names or domains. For example, an alias entry for user fred who has a mailbox on the system saturn and who is in the domain planets would have this entry in the /etc/mail/aliases file:


fred: fred@planets

How to Set Up NIS mail.aliases Map

  1. Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

  2. Become root on the NIS master server.

  3. Edit the /etc/mail/aliases file, and make the following entries:

    1. Add an entry for each mail client.

    2. Change the entry Postmaster: root to the mail address of the person who is designated as postmaster.

      See "Setting Up the Postmaster Alias" for more information.

    3. If you have created a mailbox for administration of a mail server, create an entry for root:mailbox@mailserver.

    4. Save the changes.

  4. Edit the /etc/hosts file on the NIS master server and create an entry for each mail server.

  5. Type cd /var/yp and press Return.

  6. Type make and press Return.

    The changes in the /etc/hosts and /etc/mail/aliases files are propagated to NIS slave systems. It takes a few minutes, at most, for the aliases to take effect.