NIS Client Networking  «Prev 

Specifying NIS Domains

Question: How do I specify NIS Domains in Red Hat Linux?
In Red Hat Linux, NIS (Network Information Service) domains can be specified in several ways, depending on the context in which they are used. One way to specify an NIS domain is by modifying the
/etc/sysconfig/network
file. This file contains various network-related configuration settings, including the hostname and domain name of the system. To specify the NIS domain, add the following line to the file:
NISDOMAIN=<domain_name>

Replace <domain_name> with the name of the NIS domain. This setting tells the system which NIS domain to use for authentication and other system entities. Another way to specify an NIS domain is by modifying the
/etc/yp.conf 

file. This file contains configuration settings for the NIS client, including the hostname or IP address of the NIS server and the name of the NIS domain. To specify the NIS domain, add the following line to the file:
domain <domain_name> server <server_name>

Replace <domain_name> with the name of the NIS domain and <server_name> with the hostname or IP address of the NIS server. This setting tells the NIS client which domain to use when looking up information in the NIS database.
Finally, the NIS domain can also be specified in the authconfig command when configuring the system to use NIS. For example, to configure the system to use NIS with the domain "example.com", run the following command:
authconfig --enablenis --nisdomain example.com

This command configures the system to use NIS for authentication and other system entities, and specifies the NIS domain as "dispersednet.com".

An NIS domain is a group of computers using the same NIS server for a given type of information; it does not necessarily contain the same hosts as the TCP/IP domain, although administrators often use the same names for clarity. If your network uses NIS, the network administrator should provide you with the NIS domain name to use.

Generate the NIS map Database

To install and build the NIS database, run the ypinit command. To start the ypinit program, type the following:
# /usr/lib/yp/ypinit -m

The ypinit command should automatically choose your host name to use as an NIS server. After that, it asks you to add slave servers. Add one at a time; then press Ctrl+D after you have entered your last slave server. Verify that the list of NIS servers is correct (type y). The database is built at this point. A new directory that has the name of your NIS domain is created in /var/yp. For example, if your NIS domain name is trident, the directory is /var/yp/trident. All maps built are then placed in that directory.

Adding NIS slave servers

In Red Hat Linux, NIS is configured to have a master NIS server and no slave NIS servers. You can allow your NIS maps to be pushed to one or more slave servers by setting NOPUSH=false in the /var/yp/Makefile file. After that, you need to add the names of the slave servers to your /var/yp/ypservers file. You can either add the hostnames manually or have them added automatically when you run the ypinit command later.

Network Information System (NIS) is designed to centralize administration of UNIX-like systems such as
  1. Solaris
  2. HP-UX,
  3. AIX,
  4. Linux,
  5. NetBSD,
  6. OpenBSD, and
  7. FreeBSD.

NIS was originally known as Yellow Pages but the name was changed due to trademark issues. This is the reason why NIS commands begin with yp.
NIS is a Remote Procedure Call (RPC)-based client/server system that allows a group of machines within an NIS domain to share a common set of configuration files. This permits a system administrator to set up NIS client systems with only minimal configuration data and to add, remove, or modify configuration data from a single location.