<?Pub UDT _bookmark _target?><chapter id="anis1-25461"><?Pub Tag atict:info tracking="on" ref="0"?><?Pub Tag atict:user user="sharonr" fullname="Sharon Veach"?><?Pub Tag atict:user
user="mseif" fullname=""?><title>Network Information Service (NIS) (Overview)</title><highlights><para>This chapter provides an overview of the Network Information Service
(NIS).</para><para>NIS is a distributed naming service. It is a mechanism for identifying
and locating network objects and resources. It provides a uniform storage
and retrieval method for network-wide information in a transport-protocol
and media-independent fashion.</para><para>This chapter covers the following topics.</para><itemizedlist><listitem><para><olink targetptr="anis1-36956" remap="internal">NIS Introduction</olink></para>
</listitem><listitem><para><olink targetptr="anis1-28089" remap="internal">NIS Machine Types</olink></para>
</listitem><listitem><para><olink targetptr="anis1-34824" remap="internal">NIS Elements</olink></para>
</listitem><listitem><para><olink targetptr="anis1-17499" remap="internal">NIS Binding</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="anis1-36956"><title>NIS Introduction</title><indexterm significance="preferred"><primary>NIS</primary>
</indexterm><para>By running NIS, the system administrator can distribute administrative
databases, called <emphasis>maps</emphasis>, among a variety of servers (<emphasis>master</emphasis> and <emphasis>slaves</emphasis>). The administrator can
update those databases from a centralized location in an automatic and reliable
fashion to ensure that all clients share the same naming service information
in a consistent manner throughout the network.</para><para><indexterm><primary>DNS</primary><secondary>NIS, and</secondary></indexterm>NIS was developed independently of DNS and has a slightly different
focus. Whereas DNS focuses on making communication simpler by using machine
names instead of numerical IP addresses, NIS focuses on making network administration
more manageable by providing centralized control over a variety of network
information. NIS stores information not only about machine names and addresses,
but also about users, the network itself, and network services. This collection
of network <emphasis>information</emphasis> is referred to as the NIS <emphasis>namespace</emphasis>.</para><note><para>In some contexts <emphasis>machine</emphasis> names are referred
to has <emphasis>host</emphasis> names or <emphasis>machine</emphasis> names.
This discussion uses <emphasis>machine</emphasis>, but some screen messages
or NIS map names might use <emphasis>host</emphasis> or <emphasis>machine</emphasis>.</para>
</note><sect2 id="anis1-20681"><title>NIS Architecture</title><indexterm><primary>NIS</primary><secondary>architecture</secondary>
</indexterm><indexterm><primary>NIS</primary><secondary>structure of</secondary>
</indexterm><para>NIS uses a client-server arrangement. NIS servers provide services to
NIS clients. The principal servers are called <emphasis>master</emphasis> servers,
and for reliability, they have backup, or <emphasis>slave</emphasis> servers.
Both master and slave servers use the NIS information retrieval software and
both store NIS maps.</para><para><indexterm><primary>NIS</primary><secondary>domains</secondary></indexterm><indexterm><primary>domains</primary><secondary>NIS</secondary></indexterm>NIS uses domains to arrange the machines, users, and networks
in its namespace. However, it does not use a domain hierarchy; an NIS namespace
is flat.</para><mediaobject><imageobject><imagedata entityref="fig1566.epsi"/>
</imageobject><textobject><simpara>Diagram shows 192.44.0.0 having an unidentified hierarchical
structure.</simpara>
</textobject>
</mediaobject><para>Thus, this physical network would be arranged into one NIS domain.</para><mediaobject><imageobject><imagedata entityref="fig1567.epsi"/>
</imageobject><textobject><simpara>Diagram shows 192.44.0.0 organized in a flat NIS namespace.</simpara>
</textobject>
</mediaobject><para><indexterm><primary><filename>nsswitch.conf</filename> files</primary><secondary>NIS</secondary></indexterm><indexterm><primary>NIS</primary><secondary>Internet and</secondary></indexterm><indexterm><primary>Internet</primary><secondary>NIS and</secondary></indexterm><indexterm><primary>NIS</primary><secondary>DNS, and</secondary></indexterm><indexterm><primary>DNS</primary><secondary>NIS and</secondary></indexterm>An NIS domain cannot be connected
directly to the Internet using just NIS. However, organizations that want
to use NIS and also be connected to the Internet can combine NIS with DNS.
You can use NIS to manage all local information and use DNS for Internet host
lookup. NIS provides a forwarding service that forwards host lookups to DNS
if the information cannot be found in an NIS map. The Solaris system also
allows you to set up the <filename>nsswitch.conf</filename> file so that hosts
lookup requests go only to DNS, or to DNS and then NIS if not found by DNS,
or to NIS and then DNS if not found by NIS. See <olink targetptr="a12swit-86415" remap="internal">Chapter&nbsp;2, The Name Service Switch (Overview)</olink> for details.</para>
</sect2>
</sect1><sect1 id="anis1-28089"><title>NIS Machine Types</title><indexterm><primary>NIS</primary><secondary>servers</secondary>
</indexterm><indexterm><primary>hosts (machines)</primary><secondary>NIS servers</secondary>
</indexterm><indexterm><primary>NIS</primary><secondary>clients</secondary>
</indexterm><indexterm><primary>hosts (machines)</primary><secondary>NIS clients</secondary>
</indexterm><para>There are three types of NIS machines.</para><itemizedlist><listitem><para>Master server</para>
</listitem><listitem><para>Slave servers</para>
</listitem><listitem><para>Clients of NIS servers</para>
</listitem>
</itemizedlist><para>Any machine can be an NIS client, but only machines with disks should
be NIS servers, either master or slave. Servers are also clients, typically
of themselves.</para><sect2 id="anis1-3"><title>NIS Servers</title><indexterm significance="preferred"><primary>NIS</primary><secondary>servers</secondary>
</indexterm><para>The NIS server does not have to be the same machine as the NFS file
server.</para><para><indexterm><primary>NIS</primary><secondary>master servers</secondary></indexterm>NIS servers come in two varieties, master and slave. The machine
designated as master server contains the set of maps that the system administrator
creates and updates as necessary. Each NIS domain must have one, and only
one, master server, which can propagate NIS updates with the least performance
degradation.</para><para><indexterm><primary>NIS</primary><secondary>slave servers</secondary></indexterm>You can designate additional NIS servers in the domain as slave
servers. A slave server has a complete copy of the master set of NIS maps.
Whenever the master server maps are updated, the updates are propagated among
the slave servers. Slave servers can handle any overflow of requests from
the master server, minimizing &ldquo;server unavailable&rdquo; errors.</para><para>Normally, the system administrator designates one master server for
all NIS maps. However, because each individual NIS map has the machine name
of the master server encoded within it, you could designate different servers
to act as master and slave servers for different maps. To minimize confusion,
designate a single server as the master for all the maps you create within
a single domain. The examples in this chapter assume that one server is the
master for all maps in the domain.</para>
</sect2><sect2 id="anis1-4"><title>NIS Clients</title><indexterm><primary>NIS</primary><secondary>clients</secondary>
</indexterm><indexterm><primary>clients</primary><secondary>NIS</secondary>
</indexterm><para>NIS clients run processes that request data from maps on the servers.
Clients do not make a distinction between master and slave servers, since
all NIS servers should have the same information.</para><note><para>The Solaris operating system does not support a configuration
in which a NIS client and a Native LDAP client co-exist on the same client
machine.</para>
</note>
</sect2>
</sect1><sect1 id="anis1-34824"><title>NIS Elements</title><indexterm><primary>NIS</primary><secondary>components</secondary>
</indexterm><para>The NIS naming service is composed of the following elements:</para><itemizedlist><listitem><para>Domains (see <olink targetptr="anis1-24002" remap="internal">The NIS Domain</olink>)</para>
</listitem><listitem><para>Daemons (see <olink targetptr="anis1-34815" remap="internal">NIS Daemons</olink>)</para>
</listitem><listitem><para>Utilities (see <olink targetptr="anis1-25301" remap="internal">NIS Utilities</olink>)</para>
</listitem><listitem><para>Maps (see <olink targetptr="anis1-24268" remap="internal">NIS Maps</olink>)</para>
</listitem><listitem><para>NIS Command Set (see <olink targetptr="anis1-21939" remap="internal">NIS-Related
Commands</olink>)</para>
</listitem>
</itemizedlist><sect2 id="anis1-24002"><title>The NIS Domain</title><indexterm><primary>NIS</primary><secondary>domains</secondary>
</indexterm><indexterm significance="preferred"><primary>domains</primary><secondary>NIS</secondary>
</indexterm><para>An NIS <emphasis>domain</emphasis> is a collection of machines which
share a common set of NIS maps. Each domain has a domain name and each machine
sharing the common set of maps belongs to that domain.</para><para>Any machine can belong to a given domain, as long as there is a server
for that domain's maps in the same network. An NIS client machine obtains
its domain name and binds to an NIS server as part of its boot process.</para>
</sect2><sect2 id="anis1-34815"><title>NIS Daemons</title><indexterm><primary>NIS</primary><secondary>daemons</secondary>
</indexterm><indexterm><primary>daemons</primary><secondary>NIS</secondary>
</indexterm><indexterm><primary>NIS</primary><secondary>list of daemons</secondary>
</indexterm><indexterm><primary>daemons</primary><secondary>list of NIS</secondary>
</indexterm><para>NIS service is provided by five daemons as shown in <olink targetptr="anis1-40197" remap="internal">Table&nbsp;4&ndash;1</olink>. The NIS service is managed
by the Service Management Facility. Administrative actions on this service,
such as enabling, disabling, or restarting, can be performed by using the <command>svcadm</command> command. For an overview of SMF, refer to <olink targetdoc="sysadv1" targetptr="hbrunlevels-25516" remap="external">Chapter 16, <citetitle remap="chapter">Managing Services (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.
Also refer to the <olink targetdoc="group-refman" targetptr="svcadm-1m" remap="external"><citerefentry><refentrytitle>svcadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="svcs-1" remap="external"><citerefentry><refentrytitle>svcs</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man pages for more details.</para><table frame="topbot" id="anis1-40197"><title>NIS Daemons</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="176*"/><colspec colname="column2" colwidth="352*"/><thead><row rowsep="1"><entry align="left" valign="bottom"><para>Daemon</para>
</entry><entry align="left" valign="bottom"><para>Function</para>
</entry>
</row>
</thead><tbody><row><entry align="left" valign="top"><para><indexterm><primary><command>ypserv</command> daemon</primary><secondary>description</secondary></indexterm><command>ypserv</command></para>
</entry><entry align="left" valign="top"><para>Server process</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypbind</command> daemon</primary><secondary>description</secondary></indexterm><command>ypbind</command></para>
</entry><entry align="left" valign="top"><para>Binding process</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypxfrd</command> daemon</primary><secondary>description</secondary></indexterm><command>ypxfrd</command></para>
</entry><entry align="left" valign="top"><para>High speed map transfer</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>rpc.yppasswdd</command> daemon</primary><secondary>description</secondary></indexterm><command>rpc.yppasswdd</command></para>
</entry><entry align="left" valign="top"><para>NIS password update daemon</para><para>** See NOTE below.**</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>rpc.ypupdated</command> daemon</primary><secondary>description</secondary></indexterm><command>rpc.ypupdated</command></para>
</entry><entry align="left" valign="top"><para>Modifies other maps such as <filename>publickey</filename></para>
</entry>
</row>
</tbody>
</tgroup>
</table><note><para><literal>rpc.yppasswdd</literal> considers all shells that begin
with an <literal>r</literal> to be restricted. For example, if you are in <literal>/bin/rksh</literal>, you are not allowed to change from that shell to another
one.  If you have a shell that begins with <literal>r</literal> but is not
intended to be restricted as such, refer to <olink targetptr="abtrbl-18694" remap="internal">Chapter&nbsp;7,
NIS Troubleshooting</olink> for the workaround.</para>
</note>
</sect2><sect2 id="anis1-25301"><title>NIS Utilities</title><indexterm><primary>NIS</primary><secondary>utility programs</secondary>
</indexterm><para>NIS service is supported by nine utilities as shown in <olink targetptr="anis1-11091" remap="internal">Table&nbsp;4&ndash;2</olink>.</para><table frame="topbot" id="anis1-11091"><title>NIS Utilities</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="106*"/><colspec colname="column2" colwidth="422*"/><thead><row rowsep="1"><entry align="left" valign="bottom"><para>Utility</para>
</entry><entry align="left" valign="bottom"><para>Function</para>
</entry>
</row>
</thead><tbody><row><entry align="left" valign="top"><para><indexterm><primary><command>makedbm</command> command</primary><secondary>description</secondary></indexterm><command>makedbm</command></para>
</entry><entry align="left" valign="top"><para>Creates <filename>dbm</filename> file for an NIS map</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypcat</command> command</primary><secondary>description</secondary></indexterm><command>ypcat</command></para>
</entry><entry align="left" valign="top"><para>Lists data in a map</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypinit</command> command</primary><secondary>description</secondary></indexterm><command>ypinit</command></para>
</entry><entry align="left" valign="top"><para>Builds and installs an NIS database and initializes NIS client's <filename>ypservers</filename> list.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypmatch</command> command</primary><secondary>description</secondary></indexterm><command>ypmatch</command></para>
</entry><entry align="left" valign="top"><para>Finds a specific entry in a map</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>yppoll</command> command</primary><secondary>description</secondary></indexterm><command>yppoll</command></para>
</entry><entry align="left" valign="top"><para>Gets a map order number from a server</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>yppush</command> command</primary><secondary>description</secondary></indexterm><command>yppush</command></para>
</entry><entry align="left" valign="top"><para>Propagates data from NIS master to NIS slave server</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypset</command> command</primary><secondary>description</secondary></indexterm><command>ypset</command></para>
</entry><entry align="left" valign="top"><para>Sets binding to a particular server</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypwhich</command> command</primary><secondary>description</secondary></indexterm><command>ypwhich</command></para>
</entry><entry align="left" valign="top"><para>Lists name of the NIS server and nickname translation table</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypxfr</command> command</primary><secondary>description</secondary></indexterm><command>ypxfr</command></para>
</entry><entry align="left" valign="top"><para>Transfers data from master to slave NIS server</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2><sect2 id="anis1-24268"><title>NIS Maps</title><para><indexterm><primary><command>ndbm</command></primary></indexterm><indexterm><primary>NIS maps</primary><secondary>format is <command>ndbm</command></secondary></indexterm><indexterm><primary>NIS</primary><secondary><command>ndbm</command> format</secondary></indexterm>The information in NIS maps is stored in <command>ndbm</command> format. <olink targetdoc="group-refman" targetptr="ypfiles-4" remap="external"><citerefentry><refentrytitle>ypfiles</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="ndbm-3c" remap="external"><citerefentry><refentrytitle>ndbm</refentrytitle><manvolnum>3C</manvolnum></citerefentry></olink> explain the format of the
map file.</para><para><indexterm><primary><filename>/etc</filename> files</primary></indexterm>NIS
maps were designed to replace UNIX <filename>/etc</filename> files, as well
as other configuration files, so they store much more than names and addresses.
On a network running NIS, the NIS master server for each NIS domain maintains
a set of NIS maps for other machines in the domain to query. NIS slave servers
also maintain duplicates of the master server's maps. NIS client machines
can obtain namespace information from either master or slave servers.</para><para><indexterm><primary><literal>hosts.byname</literal></primary></indexterm><indexterm><primary><filename>hosts.byaddr</filename></primary></indexterm><indexterm><primary><literal>hosts.byname</literal> maps</primary></indexterm>NIS maps
are essentially two-column tables. One column is the <emphasis>key</emphasis> and
the other column is information related to the key. NIS finds information
for a client by searching through the keys. Some information is stored in
several maps because each map uses a different key. For example, the names
and addresses of machines are stored in two maps: <command>hosts.byname</command> and <filename>hosts.byaddr</filename>. When a server has a machine's name and needs to find
its address, it looks in the <filename>hosts.byname</filename> map. When it
has the address and needs to find the name, it looks in the <literal>hosts.byaddr</literal> map.</para><para><indexterm><primary>NIS</primary><secondary><filename>Makefile</filename></secondary></indexterm><indexterm><primary><filename>Makefile</filename> file</primary><secondary>NIS</secondary></indexterm><indexterm><primary><command>makedbm</command> command</primary><secondary><command>make</command> command and</secondary></indexterm>An
NIS <filename>Makefile</filename> is stored in the <filename>/var/yp</filename> directory
of machines designated as an NIS server at installation time. Running  <command>make</command> in that directory causes <command>makedbm</command> to create or
modify the default NIS maps from the input files.</para><note><para>Always create maps on the master server, as maps created on a
slave will not automatically be pushed to the master server.</para>
</note><sect3 id="anis1-6"><title>Default NIS Maps</title><indexterm><primary>NIS maps</primary><secondary>default</secondary>
</indexterm><para>A default set of NIS maps are provided in the Solaris system. You might
want to use all these maps or only some of them. NIS can also use whatever
maps you create or add when you install other software products.</para><para><indexterm><primary><filename>/var/yp/</filename></primary></indexterm><indexterm><primary>NIS maps</primary><secondary><filename>/var/yp/</filename></secondary></indexterm><indexterm><primary>NIS</primary><secondary><filename>/var/yp/</filename></secondary></indexterm>Default maps for an NIS domain are located in each server's <filename>/var/yp/</filename><replaceable>domainname</replaceable> directory. For example,
the maps that belong to the domain <literal>test.com</literal> are located
in each server's <literal>/var/yp/test.com</literal> directory.</para><para><olink targetptr="anis1-12508" remap="internal">Table&nbsp;4&ndash;3</olink> describes
the default NIS maps, information they contain, and whether the software consults
the corresponding administrative files when NIS is running.</para><table frame="topbot" id="anis1-12508"><title>NIS Map Descriptions</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="154.79*"/><colspec colname="column2" colwidth="127.31*"/><colspec colname="column3" colwidth="245.90*"/><thead><row rowsep="1"><entry align="left" valign="bottom"><para>Map Name</para>
</entry><entry align="left" valign="bottom"><para>Corresponding NIS Admin File</para>
</entry><entry align="left" valign="bottom"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry colname="column1"><para><filename>audit_user</filename></para>
</entry><entry colname="column2"><para><filename>audit_user</filename></para>
</entry><entry colname="column3"><para>Contains user auditing preselection data.</para>
</entry>
</row><row><entry colname="column1"><para><filename>auth_attr</filename></para>
</entry><entry colname="column2"><para><filename>auth_attr</filename></para>
</entry><entry colname="column3"><para>Contains authorization names and descriptions.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>bootparams</filename></para>
</entry><entry align="left" valign="top"><para><filename>bootparams</filename></para>
</entry><entry align="left" valign="top"><para>Contains path names of files clients need during boot: root, swap, possibly
others.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>ethers.byaddr</filename></para>
</entry><entry align="left" valign="top"><para><filename>ethers</filename></para>
</entry><entry align="left" valign="top"><para>Contains machine names and Ethernet addresses. The Ethernet address
is the key in the map.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>ethers.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>ethers</filename></para>
</entry><entry align="left" valign="top"><para>Same  as <filename>ethers.byaddr</filename>, except the key is machine
name instead of the Ethernet address.</para>
</entry>
</row><row><entry colname="column1"><para><filename>exec_attr</filename></para>
</entry><entry colname="column2"><para><filename>exec_attr</filename></para>
</entry><entry colname="column3"><para>Contains profile execution attributes.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>group.bygid</filename></para>
</entry><entry align="left" valign="top"><para><filename>group</filename></para>
</entry><entry align="left" valign="top"><para>Contains group security information with group ID as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>group.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>group</filename></para>
</entry><entry align="left" valign="top"><para>Contains group security information with group name as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>hosts.byaddr</filename></para>
</entry><entry align="left" valign="top"><para><filename>hosts</filename></para>
</entry><entry align="left" valign="top"><para>Contains machine name, and IP address, with IP address as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>hosts.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>hosts</filename></para>
</entry><entry align="left" valign="top"><para>Contains machine name and IP address, with machine (host) name as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>mail.aliases</filename></para>
</entry><entry align="left" valign="top"><para><filename>aliases</filename></para>
</entry><entry align="left" valign="top"><para>Contains aliases and mail addresses, with aliases as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>mail.byaddr</filename></para>
</entry><entry align="left" valign="top"><para><filename>aliases</filename></para>
</entry><entry align="left" valign="top"><para>Contains mail address and alias, with mail address as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>netgroup.byhost</filename></para>
</entry><entry align="left" valign="top"><para><filename>netgroup</filename></para>
</entry><entry align="left" valign="top"><para>Contains group name, user name and machine name.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>netgroup.byuser</filename></para>
</entry><entry align="left" valign="top"><para><filename>netgroup</filename></para>
</entry><entry align="left" valign="top"><para>Same as <filename>netgroup.byhost</filename>, except that key is user
name.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>netgroup</filename></para>
</entry><entry align="left" valign="top"><para><filename>netgroup</filename></para>
</entry><entry align="left" valign="top"><para>Same as <filename>netgroup.byhost</filename>, except that key is group
name.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>netid.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>passwd, hosts</filename></para><para><filename>group</filename></para>
</entry><entry align="left" valign="top"><para>Used for UNIX-style authentication. Contains machine name and mail address
(including domain name). If there is a <filename>netid</filename> file available
it is consulted in addition to the data available through the other files.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>netmasks.byaddr</filename></para>
</entry><entry align="left" valign="top"><para><filename>netmasks</filename></para>
</entry><entry align="left" valign="top"><para>Contains network mask to be used with IP submitting, with the address
as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>networks.byaddr</filename></para>
</entry><entry align="left" valign="top"><para><filename>networks</filename></para>
</entry><entry align="left" valign="top"><para>Contains names of networks known to your system and their IP addresses,
with the address as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>networks.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>networks</filename></para>
</entry><entry align="left" valign="top"><para>Same as <filename>networks.byaddr</filename>, except key is name of
network.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>passwd.adjunct.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>passwd</filename> and <filename>shadow</filename></para>
</entry><entry align="left" valign="top"><para>Contains auditing information and the hidden password information for
C2 clients.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>passwd.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>passwd</filename> and <filename>shadow</filename></para>
</entry><entry align="left" valign="top"><para>Contains password information with user name as key.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>passwd.byuid</filename></para>
</entry><entry align="left" valign="top"><para><filename>passwd</filename> and <filename>shadow</filename></para>
</entry><entry align="left" valign="top"><para>Same as <filename>passwd.byname</filename>, except that key is user
ID.</para>
</entry>
</row><row><entry colname="column1"><para><filename>prof_attr</filename></para>
</entry><entry colname="column2"><para><filename>prof_attr</filename></para>
</entry><entry colname="column3"><para>Contains attributes for execution profiles.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>protocols.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>protocols</filename></para>
</entry><entry align="left" valign="top"><para>Contains network protocols known to your network.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>protocols.bynumber</filename></para>
</entry><entry align="left" valign="top"><para><filename>protocols</filename></para>
</entry><entry align="left" valign="top"><para>Same as <filename>protocols.byname</filename>, except that key is protocol
number.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>rpc.bynumber</filename></para>
</entry><entry align="left" valign="top"><para><filename>rpc</filename></para>
</entry><entry align="left" valign="top"><para>Contains program number and name of RPCs known to your system. Key is
RPC program number.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>services.byname</filename></para>
</entry><entry align="left" valign="top"><para><filename>services</filename></para>
</entry><entry align="left" valign="top"><para>Lists Internet services known to your network. Key is port or protocol.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>services.byservice</filename></para>
</entry><entry align="left" valign="top"><para><filename>services</filename></para>
</entry><entry align="left" valign="top"><para>Lists Internet services known to your network. Key is service name.</para>
</entry>
</row><row><entry colname="column1"><para><filename>user_attr</filename></para>
</entry><entry colname="column2"><para><filename>user_attr</filename></para>
</entry><entry colname="column3"><para>Contains extended attributes for users and roles.</para>
</entry>
</row><row><entry align="left" valign="top"><para><filename>ypservers</filename></para>
</entry><entry align="left" valign="top"><para>N/A</para>
</entry><entry align="left" valign="top"><para>Lists NIS servers known to your network.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>New <literal>ipnodes</literal> maps (<literal>ipnodes.byaddr</literal> and <literal>ipnodes.byname</literal>) are added to NIS. The maps store both IPv4 and IPv6
addresses.</para><note><para>Starting with Solaris Express 10/06,
the Solaris OS does not have two separate <filename>hosts</filename> files. The <filename>/etc/inet/hosts</filename> file is the single  <filename>hosts</filename> file
that contains both IPv4 and IPv6 entries. You do not need to maintain IPv4
entries in two hosts files that always require synchronization. For backward
compatibility, the <filename>/etc/inet/ipnodes</filename> file is replaced
with a symbolic link of the same name to the  <filename>/etc/inet/hosts</filename> file.
 </para><para>For more information, see the <olink targetdoc="group-refman" targetptr="hosts-4" remap="external"><citerefentry><refentrytitle>hosts</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para><para>NIS
clients and servers can communicate using either IPv4 or IPv6 RPC transports.</para>
</note><para>The <filename>ageing.byname</filename> mapping contains information
used by <command>yppasswdd</command> to read and write password aging information
to the DIT when the NIS-to-LDAP transition is implemented. If password aging
is not being used, then it can be commented out of the mapping file. For more
information about the NIS-to-LDAP transition, see <olink targetptr="nis2ldap-34" remap="internal">Chapter&nbsp;15, Transitioning From NIS to LDAP (Overview/Tasks)</olink>.</para>
</sect3><sect3 id="anis1-7"><title>Using NIS Maps</title><indexterm><primary>NIS maps</primary><secondary>working with</secondary>
</indexterm><indexterm><primary>NIS maps</primary><secondary>updating</secondary>
</indexterm><para>NIS makes updating network databases much simpler than with the <filename>/etc</filename> files system. You no longer have to change the administrative <filename>/etc</filename> files on every machine each time you modify the network environment.</para><para><indexterm><primary><command>make</command></primary><secondary>NIS maps</secondary></indexterm><indexterm><primary>NIS maps</primary><secondary>making</secondary></indexterm>For example, when you add a new machine to a network
running NIS, you only have to update the input file in the master server and
run <command>make</command>. This automatically updates the <filename>hosts.byname</filename> and <filename>hosts.byaddr</filename> maps. These maps are then
transferred to any slave servers and are made available to all of the domain's
client machines and their programs. When a client machine or application requests
a machine name or address, the NIS server refers to the <filename>hosts.byname</filename> or <filename>hosts.byaddr</filename> map as appropriate and sends the requested information
to the client.</para><para><indexterm><primary><command>ypcat</command></primary></indexterm><indexterm><primary>NIS maps</primary><secondary>displaying contents of</secondary></indexterm>You can use the <command>ypcat</command> command to display the
values in a map. The <command>ypcat</command> basic format is the following.</para><screen>% <userinput>ypcat <replaceable>mapname</replaceable></userinput></screen><para>where <replaceable>mapname</replaceable> is the name of the map you
want to examine or its <emphasis>nickname</emphasis>. If a map is composed
only of keys, as in the case of <filename>ypservers</filename>, use <command>ypcat</command> <option>k</option>. Otherwise, <command>ypcat</command> prints
blank lines. The <olink targetdoc="group-refman" targetptr="ypcat-1" remap="external"><citerefentry><refentrytitle>ypcat</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page describes more options for  <command>ypcat</command>.</para><para><indexterm><primary><command>ypwhich</command> command</primary><secondary>identifying master server</secondary></indexterm><indexterm><primary>NIS maps</primary><secondary>locating</secondary></indexterm>You can use the <command>ypwhich</command> command to determine which server is the master of a particular
map. Type the following.</para><screen>% <userinput>ypwhich</userinput> <option>m</option> <userinput><replaceable>mapname</replaceable></userinput></screen><para>where <replaceable>mapname</replaceable> is the name or the nickname
of the map whose master you want to find. <command>ypwhich</command> responds
by displaying the name of the master server. For complete information, refer
to the <olink targetdoc="group-refman" targetptr="ypwhich-1" remap="external"><citerefentry><refentrytitle>ypwhich</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</sect3><sect3 id="anis1-8"><title>NIS Map Nicknames</title><indexterm><primary>NIS maps</primary><secondary>nicknames</secondary>
</indexterm><para><emphasis>Nicknames</emphasis> are aliases for full map names. To obtain
a list of available map nicknames, such as <command>passwd</command> for <filename>passwd.byname</filename>, type <command>ypcat</command> <option>x</option> or <command>ypwhich</command> <option>x</option>.</para><para><indexterm><primary><filename>/var/yp/nicknames</filename> files</primary></indexterm><indexterm><primary><filename>nicknames</filename> files</primary></indexterm>Nicknames are stored in the <filename>/var/yp/nicknames</filename> file,
which contains a map nickname followed by the fully specified name for the
map, separated by a space. This list might be added to or modified. Currently,
there is a limit of 500 nicknames. </para>
</sect3>
</sect2><sect2 id="anis1-21939"><title>NIS-Related Commands</title><indexterm><primary>NIS maps</primary><secondary>commands related to</secondary>
</indexterm><para>The NIS service includes specialized daemons, system programs, and commands,
which are summarized in the following table.</para><table frame="topbot" id="anis1-24921"><title>NIS Command Summary</title><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="column1" colwidth="117*"/><colspec colname="column2" colwidth="411*"/><thead><row rowsep="1"><entry align="left" valign="bottom"><para>Command</para>
</entry><entry align="left" valign="bottom"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry align="left" valign="top"><para><indexterm><primary><command>ypserv</command> daemon</primary><secondary>description</secondary></indexterm><command>ypserv</command></para>
</entry><entry align="left" valign="top"><para>Services NIS clients' requests for information from an NIS map. <command>ypserv</command> is a daemon that runs on NIS servers with a complete set of maps.
At least one <command>ypserv</command> daemon must be present on the network
for NIS service to function.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypbind</command> daemon</primary><secondary>description</secondary></indexterm><command>ypbind</command></para>
</entry><entry align="left" valign="top"><para>Provides NIS server binding information to clients. It provides binding
by finding a <command>ypserv</command> process that serves maps within the
domain of the requesting client. <command>ypbind</command> must run on all
servers and clients.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypinit</command> command</primary><secondary>description</secondary></indexterm><command>ypinit</command></para>
</entry><entry align="left" valign="top"><para>Automatically creates maps for an NIS server from the input files. It
is also used to construct the initial <filename>/var/yp/binding/</filename><replaceable>domain</replaceable><filename>/ypservers</filename> file on the clients. Use <command>ypinit</command> to set up the master NIS server and the slave NIS servers
for the first time.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>make</command> command</primary><secondary>description</secondary></indexterm><command>make</command></para>
</entry><entry align="left" valign="top"><para>Updates NIS maps by reading the <filename>Makefile</filename> (when
run in the <filename>/var/yp</filename> directory). You can use <command>make</command> to
update all maps based on the input files or to update individual maps. The <olink targetdoc="group-refman" targetptr="ypmake-1m" remap="external"><citerefentry><refentrytitle>ypmake</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page
describes the functionality of <command>make</command> for NIS.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>makedbm</command> command</primary><secondary>description</secondary></indexterm><command>makedbm</command></para>
</entry><entry align="left" valign="top"><para><command>makedbm</command> takes an input file and converts it into <filename>dbm.dir</filename> and <filename>dbm.pag</filename> files &ndash; valid <command>dbm</command> files that NIS can use as maps. You can also use <command>makedbm</command> <option>u</option> to disassemble a map, so that you can see the key-value pairs that
comprise it.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypxfr</command> command</primary><secondary>description</secondary></indexterm><command>ypxfr</command></para>
</entry><entry align="left" valign="top"><para>Pulls an NIS map from a remote server to the local <filename>/var/yp/</filename><replaceable>domain</replaceable> directory, using NIS itself as the transport medium.
You can run <command>ypxfr</command> interactively, or periodically from a <filename>crontab</filename> file. It is also called by <command>ypserv</command> to
initiate a transfer.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypxrfd</command> daemon</primary><secondary>description</secondary></indexterm><command>ypxfrd</command></para>
</entry><entry align="left" valign="top"><para>Provides map transfers service for <command>ypxfr</command> requests
(generally slave servers). It is run only on the master server.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>yppush</command> command</primary><secondary>description</secondary></indexterm><command>yppush</command></para>
</entry><entry align="left" valign="top"><para>Copies a new version of an NIS map from the NIS master server to its
slaves. You run it on the master NIS server.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypset</command> command</primary><secondary>description</secondary></indexterm><command>ypset</command></para>
</entry><entry align="left" valign="top"><para>Tells a <command>ypbind</command> process to bind to a named NIS server.
This is  not for casual use and its use is discouraged because of security
implications. See the <olink targetdoc="group-refman" targetptr="ypset-1m" remap="external"><citerefentry><refentrytitle>ypset</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="group-refman" targetptr="ypbind-1m" remap="external"><citerefentry><refentrytitle>ypbind</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages
for information about the <option role="nodash">ypset</option> and <option role="nodash">ypsetme</option> options to the <command>ypbind</command> process.</para>
</entry>
</row><row><entry align="left" valign="top"><para><command>yppoll</command></para>
</entry><entry align="left" valign="top"><para>Tells which version of an NIS map is running on a server that you specify.
It also lists the master server for the map.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypcat</command> command</primary><secondary>description</secondary></indexterm><command>ypcat</command></para>
</entry><entry align="left" valign="top"><para>Displays the contents of an NIS map.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypmatch</command> command</primary><secondary>description</secondary></indexterm><command>ypmatch</command></para>
</entry><entry align="left" valign="top"><para>Prints the value for one or more specified keys in an NIS map. You cannot
specify which version of the NIS server map you are seeing.</para>
</entry>
</row><row><entry align="left" valign="top"><para><indexterm><primary><command>ypwhich</command> command</primary><secondary>description</secondary></indexterm><command>ypwhich</command></para>
</entry><entry align="left" valign="top"><para>Shows which NIS server a client is using at the moment for NIS services,
or, if invoked with the <option>m</option> <replaceable>mapname</replaceable> option,
which NIS server is master of each of the maps. If only <option>m</option> is
used, it displays the names of all the maps available and their respective
master servers.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1><sect1 id="anis1-17499"><title>NIS Binding</title><indexterm><primary>NIS</primary><secondary>binding</secondary>
</indexterm><para>NIS clients get information from an NIS server through the binding process,
which can work in one of two modes: server-list or broadcast.</para><itemizedlist><listitem><para><indexterm><primary>NIS</primary><secondary>binding, server-list</secondary></indexterm>Server-list. In the server-list mode, the <command>ypbind</command> process
queries the <filename>/var/yp/binding/</filename><replaceable>domain</replaceable>/<filename>ypservers</filename> list for the names of all of the NIS servers in the domain.
The <command>ypbind</command> process binds only to servers in this file.
The file is created by running <command>ypinit</command> <option>c</option>.</para>
</listitem><listitem><para><indexterm><primary>NIS</primary><secondary>binding, broadcast</secondary></indexterm>Broadcast. The <command>ypbind</command> process can also use
an RPC broadcast to initiate a binding. Since broadcasts are only local subnet
events that are not routed further, there must be at least one server (master
or slave) on the same subnet as the client. The servers themselves might exist
throughout different subnets since map propagation works across subnet boundaries.
In a subnet environment, one common method is to make the subnet router an
NIS server. This allows the domain server to serve clients on either subnet
interface.</para>
</listitem>
</itemizedlist><sect2 id="anis1-9"><title>Server-List Mode</title><indexterm><primary>NIS</primary><secondary>server-list binding</secondary>
</indexterm><para>The binding process in server-list mode works as follows:</para><orderedlist><listitem><para><indexterm><primary><command>ypbind</command> daemon</primary><secondary>server-list mode</secondary></indexterm><indexterm><primary>NIS</primary><secondary><command>ypbind</command> daemon</secondary></indexterm>Any program,
running on the NIS client machine that needs information provided by an NIS
map, asks <command>ypbind</command> for the name of a server.</para>
</listitem><listitem><para><command>ypbind</command> looks in the <filename>/var/yp/binding/</filename><replaceable>domainname</replaceable><filename>/ypservers</filename> file
for a list of NIS servers for the domain.</para>
</listitem><listitem><para><command>ypbind</command> initiates binding to the first server
in the list. If the server does not respond, <command>ypbind</command> tries
the second, and so on, until it finds a server or exhausts the list.</para>
</listitem><listitem><para><command>ypbind</command> tells the client process which server
to talk to. The client then sends the request directly to the server.</para>
</listitem><listitem><para><indexterm><primary><command>ypserv</command></primary></indexterm>The <command>ypserv</command> daemon on the NIS server handles
the request by consulting the appropriate map.</para>
</listitem><listitem><para><command>ypserv</command> sends the requested information
back to the client.</para>
</listitem>
</orderedlist>
</sect2><sect2 id="anis1-10"><title>Broadcast Mode</title><indexterm><primary>NIS</primary><secondary>broadcast binding</secondary>
</indexterm><para>The broadcast mode binding process works as follows:</para><orderedlist><listitem><para><indexterm><primary><command>ypbind</command> daemon</primary><secondary>broadcast mode</secondary></indexterm><command>ypbind</command> must
be started with the broadcast option set (<option role="nodash">broadcast</option>).</para>
</listitem><listitem><para><command>ypbind</command> issues an RPC broadcast in search
of an NIS server.</para><note><para>In order to support such clients, it is necessary to have an NIS
server on each subnet requiring NIS service.</para>
</note>
</listitem><listitem><para><command>ypbind</command> initiates binding to the first server
that responds to the broadcast.</para>
</listitem><listitem><para><command>ypbind</command> tells the client process which server
to talk to. The client then sends the request directly to the server.</para>
</listitem><listitem><para><indexterm><primary><command>ypserv</command> command</primary><secondary>broadcast mode</secondary></indexterm>The <command>ypserv</command> daemon
on the NIS server handles the request by consulting the appropriate map.</para>
</listitem><listitem><para><command>ypserv</command> sends the requested information
back to the client.</para>
</listitem>
</orderedlist><para>Normally, once a client is bound to a server it stays bound to that
server until something causes it to change. For example, if a server goes
out of service, the clients it served will then bind to new servers.</para><para>To find out which NIS server is currently providing service to a specific
client, use the following command.</para><para>%<userinput>ypwhich <replaceable>machinename</replaceable></userinput></para><para><indexterm><primary><command>ypwhich</command></primary><secondary>identifying bound server</secondary></indexterm><indexterm><primary>NIS</primary><secondary><command>ypwhich</command></secondary></indexterm>Where <replaceable>machinename</replaceable> is
the name of the client. If no machine name is mentioned, <command>ypwhich</command> defaults
to the local machine (that is, the machine on which the command is run).</para>
</sect2>
</sect1>
</chapter><?Pub *0000050048 0?>