nis

Sun’s Network Information Services (NIS) V8.1 and later

Sun Microsystems offers a network information service called NIS. It provides the ability to look up various kinds of information in network databases. The nis type allows you to access that network information by way of rules in rule sets. You declare an nis database-map type like this:

Kname nis nismap

Here, name is the identifier that you will later use in rule sets. The nismap is any NIS database map that defaults to mail.aliases. Lookups will occur in the default NIS domain. If you wish to specify some other domain, you can append an @ character and the domain name to the nismap:

Kname nis nismap @ domain

To illustrate, consider the need to look up the name of the central mail server for your department. If such a database map were called mailservers, you could use the following configuration file line to look up your domain in that database map:

Kmailservers nis -o mailservers
...
R $* <@ $+ > $*          $: $1<@$2>$3 <$(mailservers $2 $)>
R $* <@ $+ > $* <$+>     $#smtp $@ $4 $: $1 < @ $2 > $3
...

Here, we look up the host part of an address ($2) in the mailservers NIS database map. The -o makes the existence of the database map optional. If the host part is found, it is rewritten to be the name of the mail server for that host. In the last rule, we forward the original address to that server.

Without the -o, the nonexistence of a database map will cause this error to be logged:

Cannot bind to map name in domain  domain:  reason here

If ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.