Cisco CNS Network Registrar CLI Reference Guide, 5.0
About the Nrcmd Program

Table of Contents

About the Nrcmd Program

About the Nrcmd Program

You can use either Network Registrar's graphical user interface (GUI) or nrcmd command line interface (CLI) to configure and manage your DNS and DHCP servers. This chapter describes how to use the nrcmd command line interface.

It specifically describes:

  • Invoking the nrcmd command

  • Using the nrcmd command arguments

  • Listing the nrcmd commands

Invoking the Nrcmd Command

You can use the nrcmd command in batch mode by executing scripts that use the commands or by using the interactive mode in which you enter commands at the nrcmd command prompt.


Note   The nrcmd command is located in \Program Files\Network Registrar\bin on Windows NT and in /opt/nwreg2/usrbin on Solaris.

The command syntax is as follows:

nrcmd <general options> <command> <specific options>

 

The general options are:

  • -C clustername

  • -N username

  • -P password

These general options are not required. If you supply them, you must proceed them with -C, -N, or -P. If you do not supply them, Network Registrar gets them from the registry (on Windows NT), or environment variables (on Solaris and Windows NT). If Network Registrar cannot find values for these parameters, it prompts you for them.

The Windows NT registry and Solaris or Windows NT environment variables are AIC_NAME for the name, AIC_PASSWORD for the password, and AIC_CLUSTER for the cluster name. The Windows NT registry path is Software\American Internet\Registrar\2.0 and the registry hive is HKEY_CURRENT_USER.

To execute the command line interface in interactive mode, enter:

nrcmd [-C cluster] [-N user] [-P password]

 

Typing this command displays the interactive prompt nrcmd> to which you enter:

nrcmd>command  [optional parameters ]

 

To specify a series of items, use commas between the items. Do not add a space after the comma. For example:

nrcmd>zone example.com. set dynupdate-set=192.168.1.1,127.0.0.1

 

To terminate an interactive session, enter the exit command.

To view the online help, enter the help command.

Command Organization

The nrcmd commands specify a class of object which you can create, delete, or list. Each of these objects in turn has properties which you can set or get, and features which you can enable, disable, or test. These objects may also have methods, which are specific to the type of object, and that let you perform operations on groups of properties.

When you use the nrcmd commands to configure Network Registrar, you manipulate the following:

Command Usage

How you specify a series of arguments depends on the type of command you are using. The following shows the differences when using the create, set, and enable commands.

Create Command

When you use the create command and there are required arguments, you must supply them. You can also supply additional arguments. You must supply the required arguments in the specified order; however, you can specify the optional arguments in any order with the syntax prop=value.

For example, the syntax for creating a scope is as follows:

scope name create addr mask [prop=value]

 

This means that you must supply an IP address and mask when you create a scope, and you can optionally specify other properties of the scope.

The following example creates the scope testScope with the IP address of 128.103.1.1 and a mask of 255.255.255.0:

nrcmd>scope testScope create 128.103.1.1 255.255.255.0
 

For example, if you want to create a scope and also specify the name of the DNS zone to which a DHCP client's host name should be added, enter:

nrcmd>scope testScope create 128.103.1.1 255.255.255.0 dns-zone-name=QuickExample.com
 

After the create command creates and assigns all specified parameters to the object, it checks that all the required properties have values (either defaults or user-specified). If you neglect to supply the required arguments, Network Registrar reports an error.

Set Command

You use the set command to set the value of a property. If you want to set a list of things, such as DNS servers, or IP addresses, you can separate them with commas. You can also use the set command to set several properties on a single line—just specify the property and its value followed by a space and the next property and value pair.

For example, to specify the name of the DNS zone to which a DHCP client's host name should be added, enter:

nrcmd>scope testScope set dns-zone-name=QuickExample.com
 

For example, to specify the list of IP addresses that you will allow to perform zone transfers, enter:

nrcmd>zone QuickExample.com set auth-servers=196.68.1.10,196.68.1.20
 

For example, to set the client's client-class and domain-name, enter:

nrcmd>client 1,6,02:02:02:02:02:02 set client-class-name=internal 
domain-name=QuickExample.com
 

Additionally, you can set a feature to its enabled state (set feature=enabled).

The unset command places a property or feature in the undefined state.

Enable Command

You use the enable command to enable a feature. After you enable a feature you often need to set its associated properties.

For example, to enable incremental transfer processing for the DNS server, enter:

nrcmd>dns enable ixfr-enable
 

To change the incremental transfer expiration interval, enter:

nrcmd>dns set ixfr-expire-interval=10d

Note   You cannot add set commands to an enable command line. You need to first enable the feature, and then on the next command line, set the associated properties.

Saving Your Changes

The CLI waits for one of the following events to occur before it saves your changes to the database:

  • Invoking the save command

  • Exiting from nrcmd

  • Reloading a server

  • Adding a resource record or a host to a zone


Note   Network Registrar saves resource records immediately.

Command Line Navigation Keys

Table 1-1 lists keyboard navigation key combinations that are useful when entering nrcmd commands.


Table 1-1: Nrcmd Navigation Key Combinations
Key Combination Action

Control-a

Go to the beginning of the line

Control-b

Back one character

Control-d

Delete one character

Control-e

Go to the end of the line

Control-f

Forward one character

Control-k

Kill to the end of the line

Control-l

Redraw the line

Control-n

Next line in the history

Control-p

Previous line in the history

Control-t

Shift an individual character left

Control-u

Delete the line and move the cursor to the beginning of the line

Control-w

Delete one word backwards

Esc-b

Back one word

Esc-f

Forward one word



Nrcmd Commands

Table 1-2 lists the nrcmd commands, alphabetically. You can use these commands on the command line or insert them into scripts.


Table 1-2: Nrcmd Commands
Command Description

admin

Creates administrators and assigns them passwords

client

Creates clients and assigns them to client-classes

client-class

Creates client-classes

client-class policy

Sets embedded client-class policies

client-policy

Sets embedded client policies

custom-option

Creates a custom DHCP option

dhcp

Specifies the DHCP server's properties

dhcp-interface

Specifies the IP address of the DHCP server's hardware card

dns

Specifies the DNS server's properties

exit

Quits the nrcmd command

export

Writes the state of the lease or a zone to a file

extension

Integrates user-written DHCP extensions into the Network Registrar DHCP server

force-lock

Obtains an exclusive lock for the nrcmd command session

help

Provides online help

import

Loads configuration information from a file

ldap

Specifies the LDAP remote server's properties

lease

Specifies DHCP leases' properties

lease-notification

Notifies you when you run out of available leases in a scope

license

Views and updates license information

option-datatype

Defines data types for use in defining vendor-supplied DHCP options

policy

Specifies the policy information

remote-dns

Specifies information about remote DNS servers

report

Creates a summary of the dynamic and static IP address utilization for one or more clusters

save

Saves the current configuration changes

scope

Specifies the scopes' properties

scope-policy

Sets embedded scopes properties

scope-selection-tag

Creates scope selection tags

server

Affects server behavior

session

Configures session parameters

tftp

Specifies the TFTP server's properties

vendor-option

Defines vendor-supplied DHCP options

zone

Specifies the DNS zones' properties