JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Naming and Directory Services (NIS+)
search filter icon
search icon

Document Information


Part I About Naming and Directory Services

1.  Name Service Switch

Part II NIS+ Setup and Configuration

2.  NIS+: An Introduction

3.  NIS+ Setup Scripts

4.  Configuring NIS+ With Scripts

5.  Setting Up the NIS+ Root Domain

6.  Configuring NIS+ Clients

7.  Configuring NIS+ Servers

8.  Configuring an NIS+ Non-Root Domain

9.  Setting Up NIS+ Tables

Part III NIS+ Administration

10.  NIS+ Tables and Information

11.  NIS+ Security Overview

12.  Administering NIS+ Credentials

13.  Administering NIS+ Keys

14.  Administering Enhanced NIS+ Security Credentials

15.  Administering NIS+ Access Rights

16.  Administering NIS+ Passwords

17.  Administering NIS+ Groups

18.  Administering NIS+ Directories

19.  Administering NIS+ Tables

NIS+ Table Administration

Using the nistbladm Command With NIS+ Tables

nistbladm Syntax Summary

nistbladm and NIS+ Column Values

nistbladm, Searchable NIS+ Columns, Keys, and Column Values

nistbladm and Indexed NIS+ Names

nistbladm and NIS+ Groups

Creating a New NIS+ Table

Specifying NIS+ Table Columns

Creating Additional NIS+ Automount Tables

Deleting an NIS+ Table

Adding Entries to an NIS+ Table

Adding an NIS+ Table Entry With the -a Option

Adding an NIS+ Table Entry With the -A Option

Modifying NIS+ Table Entries

Editing an NIS+ Table Entry With the -e Option

Editing an NIS+ Table Entry With the -E Option

Removing NIS+ Table Entries

Removing NIS+ Single Table Entries

Removing Multiple Entries From an NIS+ Table

niscat Command

niscat Command Syntax

Displaying the Contents of an NIS+ Table

Displaying the Object Properties of an NIS+ Table or Entry

nismatch and nisgrep Commands

About Regular Expressions in NIS+

nismatch and nisgrep Command Syntax

Searching the First Column in NIS+

Searching a Particular Column in NIS+

Searching Multiple Columns in NIS+

nisln Command

nisln Command Syntax

Creating a Link in NIS+

nissetup Command

Expanding a Directory Into an NIS+ Domain

Expanding a Directory Into an NIS-Compatible Domain

nisaddent Command

nisaddent Command Syntax

Loading Information Into NIS+ From a File

Loading Data From an NIS Map Into NIS+

Dumping the Contents of an NIS+ Table to a File

20.  NIS+ Server Use Customization

21.  NIS+ Backup and Restore

22.  Removing NIS+

23.  Information in NIS+ Tables

24.  NIS+ Troubleshooting

A.  NIS+ Error Messages

About NIS+ Error Messages

Common NIS+ Namespace Error Messages

B.  Updates to NIS+ During the Solaris 10 Release

Solaris 10 and NIS+



Adding Entries to an NIS+ Table

To add new entries (rows) to a table, use nistbladm with either the -a or -A options followed by either one or more column=value pairs and the table name or an indexed name as described in nistbladm and Indexed NIS+ Names.

nistbladm [-a | -A] indexedname
nistbladm [-a | -A] column="value" \
column="value" \
... tablename

When adding new entry rows to a table with either -a or -A:

Note - NIS+ is a naming service and its tables are designed to store references to objects, not the objects themselves. NIS+ is optimized to support 10,000 objects with a combined total size of all tables not more than 10M bytes. NIS+ does not support individual tables where the sum of field sizes in a single column are greater than approximately 7k. If a table is too large, rpc.nisd may fail.

Adding an NIS+ Table Entry With the -a Option

The -a option adds an entry to a table unless the entry already exists, in which case it returns an error. An entry is defined as existing if its values in the searchable columns exactly match the values in the new entry's searchable columns. (The values in non-searchable columns are not taken into account.)

To use the -a option, you must specify a value for every column in the table:

nistbladm -a column="value" \
 column="value" \
 ... tablename
nistbladm -a indexedname

(To list the names and characteristics of table columns, use the niscat -o tablename command.)

For example, to add a new row to a table named depts using column=value pairs, you would enter:

rootmaster% nistbladm -a Name='R&D' Site='SanFran' \

To add the same entry using an indexed name, you would enter:

rootmaster% nistbladm -a [Name='R&D',Site='SanFran',\

Both examples would produce a table row that looked like this:


C-shell users should also use quotes to set off expressions using square brackets.

You can only add one entry with each instance of the nistbladm command. You must run nistbladm once for each entry row you want to add.

If a table row already exists with values in each column that are identical to the entry you are trying to create, nistbladm -a will return an error. You cannot have two identical entry rows in a table. In this context, rows are considered identical if the values in the searchable columns are identical, the values in none search able columns are not considered.

For example, if the Dept and Site columns are searchable, and the Name column is not searchable, nistbladm considers the following two rows to be identical:

Dept (searchable)
Site (searchable)
Name (not searchable)

In this example, nistbladm -a would not allow you to create the Sales Vancouver Lincoln row.

However if just some of the searchable columns have values identical to the entry you are trying to create, nistbladm -a will create a new entry as specified. For example, you could run the following commands to create two similar, but not identical, rows in a depts table:

rootmaster% nistbladm -a Dept='Sales' \
   Site='Vancouver' Name='hosteen'
rootmaster% nistbladm -a Dept='Sales' \
   Site='SanFran' Name='lincoln'

Which would produce rows that had some, but not all identical values in the searchable columns:


Adding an NIS+ Table Entry With the -A Option

The -A option is designed for applications where you need to force nistbladm to overwrite an existing entry. Like the -a option, -A adds a new entry to a table. However, if the entry already exists, instead of exiting with an error, it overwrites the existing entry row.

When using the -A option, you must specify all columns in the entry.

For example, suppose the following table exists and the Dept and Site columns are searchable:

Dept (searchable)
Site (searchable)

Now you run the following command:

rootmaster% nistbladm -A Name=Sales Site=SanFran \

The -a option would have returned an error, since the entry specified by Name=Sales Site=SanFran already exists. But the -A option allows you to overwrite the existing row.