|
|
The Network Registrar nrcmd program is a command-line based configuration tool. It allows you to set all Network Registrar configurable options as well as start and stop the servers.
This section contains the complete list of nrcmd commands. You can use them on the command line or insert them into scripts. The commands are grouped alphabetically.
Table 2-1 lists and describes the nrcmd commands.
| Command | Description |
|---|---|
Creates administrators and assigns them passwords | |
Creates clients and assigns them to client-classes | |
Creates client-classes | |
Specifies the DHCP server's properties | |
Specifies the IP address the DHCP server's hardware card | |
Specifies the DNS server's properties | |
Quits the nrcmd program | |
Writes the state of the lease or a zone to a file | |
Integrates user-written DHCP extensions into the Network Registrar DHCP server | |
Obtains an exclusive lock for the nrcmd program session | |
Provides online help | |
Loads configuration information from a file | |
Specifies the LDAP remote server's properties | |
Specifies DHCP leases' properties | |
Views and updates license information | |
Reports IP address utilization | |
Specifies the policy information | |
Specifies information about remote DNS servers | |
Saves the current configuration changes | |
Specifies the scopes' properties | |
Creates scope selection tags | |
Affects server behavior | |
Configures session parameters | |
Specifies the DNS zones' properties |
Use the admin command to configure administrators for the cluster. You can choose any string for the name. Network Registrar uses the password to authenticate the name. If you create an administrator without a password, Network Registrar cannot authenticate the name, and will deny that user access to the cluster.
Because the password is sensitive information, Network Registrar prints its value as a string of astericks.
The syntax is:
admin name create [prop=value] admin name delete admin list
To create the administrator bob with the password xyz, type:
nrcmd> admin bob create password=xyz
To delete the administrator bob, type:
nrcmd> admin bob delete
You can use the set, get, and show commands to assign and retrieve values from the admin properties.
The syntax is:
admin name set prop=value admin name get prop admin name show admin name enterPassword password
If you want to enter a password and not have Network Registrar display the password on your screen, create an administrator and do not supply a password. Then use the enterPassword command to enter a password and prevent Network Registrar from echoing it on the screen. Network Registrar prompts you to verify the password before it accepts it.
Table 2-2 lists and describes the admin property.
| Property | Description |
|---|---|
The administrator's password |
The client and client-class commands allow you to create and manipulate clients and groups of clients for the purpose of determining what type of IP address or policy to assign to requesting hosts.
Using the client command you can assign properties to a specific client entry, based on the client's MAC address or the literal string default, which matches any client that does not have a specific client configuration. The properties you can assign include such things as a class of client, a policy, an action, and the inclusion or exclusion of scope selection tags. The DHCP server looks up these properties to determine how it should process the host's request for an IP address.
You can configure common client properties such as selection criteria, in one client-class configuration, and have multiple client configurations use it.
The DHCP server reads the client configuration information each time it receives a request for an IP address, so you do not have to reload the server after modifying these client configurations. If you modify the default client configuration, you must reload the server in order for the change to take effect.
To specify the client use the MAC address in the format of hardware-type,hardware-length,hardware address or the word default. The commas are required.
A sample Ethernet MAC address might be 1,6,00:a0:24:2e:9c:20.
The syntax is:
client name create [prop=value] client name delete client list
To create a client that is a member of the external client-class, type:
nrcmd> client 1,6,02:02:02:02:02:02 create client-class-name=external
To delete client 1,6,02:02:02:02:02:02:, type:
nrcmd> client 1,6,02:02:02:02:02:02 delete
To list all the client-classes, type:
nrcmd> client list
The property list contains the name and values in the following format: property=value{,value}.
For the host-name and domain-name strings to have any effect, you must have enabled dynamic DNS update in the scope from which the IP address was allocated.
You use the set and get commands to set and display their values.
The syntax is:
client macaddress set property=val client macaddress get property client macaddress show
Table 2-3 lists and describes the client command properties.
| Property | Description |
|---|---|
The action to take for this client. You can specify either exclude or one-shot. For more information about these two actions, see the "Action Strings" section later in this chapter. | |
(Client-only) Specifies whether to limit the authentication time to the duration you have specified. For more information about how to specify the time, see the "Authenticate-Until" section later in this chapter. | |
(Client-only) The client-class to which the client belongs. The client-class-name property may only appear in the client entry. It is an error to specify a client-class name property in a client-class object. If the client is not a member of a client-class, then the DHCP server uses the default client-class properties. | |
The domain name to use when performing DNS updates. Places the client's A record in this DNS domain. | |
The host name. Use this string to replace any host-name DHCP option sent by the DHCP client. For more information about host names, see the "Host Name Strings" section later in this chapter. | |
The policy to add to the Network Registrar DHCP policy search list for this client. | |
The scope selection tags to build the scope inclusion list. | |
The scope selection tags to build the scope exclusion list. | |
The name of the client-class to use if this client is no longer authenticated. | |
A user-defined string that can be set and queried. This property has no effect on the operation of the DHCP server. |
The action string is made up of one or more comma-delimited tokens. Valid tokens are the following:
You can use the one-shot action to allocate provisional addresses, which are useful when you want an unknown client to have an address for only a short period of time.
To use one-shot action to assign an address to an unknown client for a short period of time, configure the one-shot argument as the action for the default client (or in the client-class specified by the default client). This configuration causes the server to give a lease to an unknown client, but when the lease expires, the server will not respond to that client for the duration of the grace period. After the grace period expires, the server will not respond to that client until the now available lease is reallocated to another client. This final period may be short or long, depending on the number of leases in the scope, and the number of clients using them. Newly available leases go on the end of a queue, and are allocated from the beginning of a queue, so that it might be quite some time before this lease is reallocated to another client.
It is possible to allow the client a relatively short lease time, such as one day, and then specify a long grace period, such as two weeks. In this manner, you can offer an incentive to the client to register with some authority and become a known client, while preventing the lease from being reallocated to another client.
After the lease expires, the client is unable to get another address for the extent of the two-week grace period. You can configure the lease and grace period differently for each scope, so that the nonprovisional leases can have different lease and grace periods.
After the lease is reallocated to another client, all record of the first client's use is lost, and the first client could get another lease as an unknown client and have another opportunity to register.
Using provisional addresses is less restrictive if you use multiple DHCP servers, because each one operates its one-shot capabilities independently. With the above approach and two DHCP servers, an unregistered client could get two days of provisional address use every two weeks.
When the authentication for a client entry is no longer authenticated, the DHCP server uses the value of the unauthenticated-client-class property for the name of the client-class entry to use in answering this DHCP request. If the unauthenticated-client-class property is not set or if there is no client-class entry in the unauthenticated-client-class property, the DHCP server ignores the DHCP request; that is, the server will not provide the client an IP address.
The following are valid authentication values:
The value you specify in the host-name property can be one of two general forms.
The first form is a string that does not start with a @. This form of host-name value is used to override the DHCP client-request host name. When you enter a valid name, you cause the DHCP server to ignore any host name specified by this client, and instead use this client-entry property. The actual value of the host-name option in the client's DHCP packet is ignored.
The second form is a string that starts with the special token @. Network Registrar uses this form of host-name value to signal the following special handling:
The client-class command allows you to apply a set of properties to a group or class of clients.
The syntax is:
client-class name create [prop=val] client-class name delete client-class list
To create the client-class internal, type:
nrcmd> client-class internal create
To delete the client-class internal, type:
nrcmd> client-class internal delete
To list the all the client-classes that use the policy short-lease-time, type:
nrcmd> client-class list policy=short-lease-time
The client-class command allows you to configure and display common properties for DHCP client configurations using the set, get, and show commands.
Unlike most client configurations, the DHCP server reads the client-class configurations at server start-up time, and you must reload the server for changes to take effect.
The syntax is:
client-class name set prop=val client-class name get prop client-class name show
See Table 2-3 for descriptions of the properties.
The server processes client and client-class property values as follows:
The dhcp command allows you to configure the DHCP server in the cluster. In Network Registrar Software Release 2.0 there is only one DHCP server per cluster, so you do not need to reference the server by name.
The syntax is:
dhcp disable feature dhcp enable feature dhcp get feature
Table 2-4 lists and describes the DHCP features.
| Feature | Description |
|---|---|
Controls whether or not the DHCP server uses the client and client-class configuration objects to affect request processing. Default disabled. | |
Causes the DHCP server to find all the interface cards on the host and process DHCP requests that it receives from any of them. It will, however, only offer addresses to requests from subnets in which you have defined a valid scope with available addresses. If you do not enable this feature, the DHCP server uses only its list of configured interfaces. Default enabled. | |
Causes the server to drop a packet (if possible) when it encounters a script failure. Default enabled. | |
Causes the DHCP server to recognize only packets generated from the nrcmd program's import leases command and ignore all others. You can use this property if you want to update your DHCP server and prevent clients from receiving addresses during this period. Default disabled. For more about import mode, see following section, "Import Mode." | |
Causes the DHCP server to use the client's MAC address as the only client identifier. The standard behavior, as specified in RFC 2132, is to use the client ID option (if it is present) as the unique client identifier. If you specify the mac-address-only argument, the DHCP server ignores the client's ID and uses its MAC address instead. You can use this argument to have a single, consistent way of identifying all clients that use your DHCP server. Default disabled. |
You can put the DHCP server into import mode by enabling the import-mode feature and then restarting the server. You take the server out of import mode by disabling the feature and restarting the server. You can use import mode to exclude all DHCP lease requests except for the specially tagged ones that come from nrcmd during lease import. See the "Import" section later in this chapter.
To enable the client-class facility for this DHCP server, type:
nrcmd> dhcp enable client-class
To disable import mode, type:
nrcmd> dhcp disable import-mode
To display whether discover-interface is enabled or disabled, type:
nrcmd> dhcp get discover-interfaces
You can use the set, get, unset, and show commands to assign and retrieve values from the DHCP's name-value properties.
The syntax is:
dhcp get prop=val dhcp set prop=val dhcp unset prop dhcp show
Table 2-5 lists and describes the DHCP properties.
| Property | Description |
|---|---|
Controls the number of milliseconds the DHCP server will wait for a response before retrying a dynamic DNS request. | |
Is the default value of the extension trace level for every request object. You can override this value by setting the extension-trace-level in a user-written extension. Setting the level to zero causes very little tracing. Setting the level to three causes considerable tracing. For more information about DHCP extension creation, see the "Extension" section later in this chapter. | |
Controls whether the DHCP server sends unicast instead of broadcast responses when a client indicates that it can accept a unicast. This feature may not be available on all platforms. | |
Controls whether the DHCP server logs additional detail about the events listed in the log-settings. This can be helpful when you are analyzing a problem, but leaving it enabled for a long period can cause the log files to fill up. For more information about the different log settings, see the "Log Settings" section later in this chapter. | |
Controls the size of buffers DHCP allocates for responding to DHCP clients. At least 100 buffers of each type should be allocated, and perhaps as many as several thousand would be reasonable in some installations. | |
Controls the size of buffers DHCP allocates for receiving packets from DHCP clients. At least 100 buffers of each type should be allocated, and perhaps as many as several thousand would be reasonable in some installations. | |
Controls the size of buffers DHCP allocates for communication with DNS servers. You can reduce the DHCP server's memory requirement by reducing the number of DNS packets, at the risk of missing updates. | |
Controls the number of times the DHCP server can try to add a host into DNS even if it detects that the host's name is already present in DNS. This field controls the number of times the DHCP server will attempt to modify a host's name in order to resolve a conflict. | |
Controls the number of times the DHCP server attempts to send dynamic DNS updates to a DNS server. | |
Sets the time to live (TTL) ceiling, in seconds, for DNS records added through dynamic DNS. When the DHCP server adds a DNS record, it sets the TTL to less than one-third of the lease time, or this ceiling value. The DNS record's effective TTL may be determined by the DNS zone's minimum TTL. | |
Causes the DHCP server to release any other leases the client may have had on this server. Because the default behavior for the Network Registrar DHCP server is to store all the leases a client obtains, this command ensures that only one lease is stored. A client might obtain a number of leases if a user with a laptop traveled throughout the building and requested leases at different locations on the network. | |
(Windows NT 3.51 only) In each scope there is a ping timeout number, which is the number of milliseconds that the ping subsystem waits for the ping to respond. The ping queue timeout factor value is the multiple that it waits. The default is 75 seconds. | |
Lists scope selection tags associated with this scope. In this context the term tags refers to a named entity that is used to control matching client and client-class entries with candidate scopes. | |
If the server is replying to a BOOTP request, and is offering a lease from a scope that is configured for DNS updates, the DHCP server checks this property before beginning the update. You can use this feature to prevent DNS updates for BOOTP clients, while allowing updates for DHCP clients. | |
Controls whether the DHCP server attempts to read client-entry data through LDAP, that is, using the configuration supplied by the ldap command. For more information about the ldap command, see the "Ldap" section later in this chapter. |
To set the scope selection tag internal, type:
nrcmd> dhcp set scope-selection tags=internal
To display whether hardware-unicast has been set, type:
nrcmd> dhcp get hardware-unicast
To make the one-lease-per-client have no value, type:
nrcmd> dhcp unset one-lease-per-client
You can set the following flags:
To suppress warning messages for unconfigured or missing options, type:
nrcmd> dhcp set log-settings=default,incoming-packet
To turn on client and client-class debugging for the DHCP server, type:
nrcmd> dhcp set log-settings=client nrcmd> dhcp reload
To turn off debugging for the DHCP server, type:
nrcmd> dhcp set log-settings=default nrcmd> dhcp reload
As an additional aid to troubleshooting your configuration you can use the example extension, dextrace, distributed on the Cisco Network Registrar 2.0 CD. It looks for a particular MAC address in every input packet. When it finds that MAC address, it enables packet sniffing for just that input and any corresponding output packet. You can configure this extension using the CLI, and the configuration commands are in the example source file for dexextension.c. This extension places only a very small load on the server, and is suitable for long-term use when trying to diagnose some DHCP problem in which a troublesome MAC address is known, but it is not possible (or perhaps not convenient) to manually stimulate that DHCP client directly in order to find the problem.
You can use the method commands attachExtension, detachExtension, and listExtensions to configure the extensions points in the server. You can name each extension point and associate one extension with it. For more information about extensions, see the "Extension" section later in this chapter.
The syntax is:
dhcp attachExtension extension-point extension-name dhcp detachExtension extension-point dhcp listExtensions
To add the test extension at the extension point post-packet-decode, type:
nrcmd> dhcp attachExtension post-packet-decode test
To remove the extension test from the extension point post-packet-decode, type:
nrcmd> dhcp detachExtension post-packet-decode
To list all the extensions points and any extensions associated with them, type:
nrcmd> dhcp listExtensions
The dhcp-interface command allows you to add, remove, and list the IP addresses of your server's hardware card (such as Ethernet or token ring), also called the Interface card. Interfaces are named with the IP address and net mask for the physical device.
You can list the interfaces to provide either an explicit list of interfaces that the DHCP server should listen on or an explicit list of interfaces that the DHCP server should not listen on.
The dhcp-interface command provides more functionality than is provided through the GUI. This command provides functionality in the following form:
The syntax is:
dhcp-interface name create addr [mask] dhcp-interface name delete dhcp-interface list dhcp-interface name show dhcp-interface get prop dhcp-interface set prop=val [prop=val...] dhcp-interface unset prop
Table 2-6 lists and describes the DHCP interface properties.
| Property | Description |
|---|---|
The IP address of the interface. | |
Indicates that the server should ignore this interface, which might be the case if you had several interfaces. You can use this property to temporarily disable a specific interface in a list of interfaces. | |
The subnet number. |
To create two different interface configurations, type:
nrcmd> dhcp-interface net1 create 192.168.1.12 255.255.255.0 nrcmd> dhcp-interface net2 create 10.1.2.3 255.255.255.0
To cause Network Registrar not to look at one interface, type the following command. You must create the interface specification before you can set it to be ignored.
nrcmd> dhcp-interface net1 set ignore=true
To delete the interface specification net1, type:
nrcmd> dhcp-interface net1 delete
To list all the specified interfaces, type:
nrcmd> dhcp-interface list
The dns command allows you to enable or disable DNS server features. In Network Registrar Software 2.0 there is only one DNS server per cluster, so you do not need to reference the server by name.
The syntax is:
dns disable feature dns enable feature dns get feature
Table 2-7 lists and describes the DNS features.
| Feature | Description |
|---|---|
Required, default enabled. Controls the incremental transfer behavior for zones for which you have not configured a specific behavior. For more information about incremental transfer, see the following section, "Incremental Transfer." | |
Required, default disabled. Controls whether you want Network Registrar to notice and log when a DNS server listed in a parent-zone's delegation of subzones does not know that it is authoritative for the zone. | |
Required, default disabled. Controls whether you want the DNS server, when composing a response to a query, to fetch missing glue records. Glue records are DNS A records that specify the address of a domain's authoritative name server. Normal DNS responses include NS records and their A records related to the name being queried. | |
Required, default disabled. Controls whether you want to disable forwarding client queries to other name servers when your DNS server is not authoritative for data being queried. If you disable recursive queries, you make your name server a noncaching server. | |
Required, default enabled. Controls NOTIFY sending notification for zones for which you have not configured a specific behavior. For more information about NOTIFY, see the "NOTIFY" section later in this chapter. | |
Required, default enabled. Controls whether you want round-robin cycling of equivalent records in responses to queries. Equivalent records are records of the same name and type. Because clients often only look at the first record of a set, enabling this feature can help balance loads and keep clients from forever trying to talk to an out-of-service host. | |
Required, default disabled. Controls whether you want this server to be a slave server, which is a server that relies entirely on forwarders for data that is not in its cache. This command has no effect unless you also specify the corresponding forwarders. You can override slave-mode for specific domains with the DNS exception method. For more information about the exception method, see the "DNS Methods" section later in this chapter. | |
Required, default disabled. Enables relaxation of the RFC 2136 restriction on the zone name record in dynamic updates. This feature allows updates to specify a zone name, which is any name within an authoritative zone, instead of the exact name of the zone. |
The incremental transfer feature (ixfr-enable) allows you to control how your DNS server handles incremental transfer. If you enable incremental transfer, you must set or accept the default value of the ixfr-expire-interval property.
Table 2-8 lists and describes the incremental transfer properties.
| Property | Description |
|---|---|
Required, default 604800 seconds (7 days). Indicates the longest interval to allow a secondary zone to be maintained solely with incremental transfers. After this period, the server requests a full zone transfer. Validation: 0 <= x <= 2147483647 |
To enable incremental transfer for all zones, type:
nrcmd> dns enable ixfr-enable
To disable incremental transfer for the single zone example.com, type:
nrcmd> zone example.com disable ixfr
To disable incremental transfer for the single remote-dns server (or subnet) 128.103.1.1, type:
nrcmd> remote-dns create 128.103.1.1 set ixfr=false
For more information about setting incremental transfer on specific zones or remote DNS servers, see the "Zone" or "Remote-Dns" section later in this chapter.
Because a master server for a zone does not know specifically which slaves transfer from it, Network Registrar notifies all registered name servers for the zone (name servers listed in the NS Resource Records) when the zone changes. The sole exception to this policy is that Network Registrar does not notify the server named in the SOA mname field (the primary master). For more information about NOTIFY, see RFC 1996.
If you enable NOTIFY, you must set or accept the defaults for the properties listed in Table 2-9.
| Property | Description |
|---|---|
Required, default 100. The maximum number of changes you want to accumulate during the notify-wait period. If this number is exceeded, Network Registrar sends notification before the notify-wait period has passed. | |
Required, default 2 seconds. The minimum interval required before sending notification of consecutive changes on the same zone to a particular server. Validation: 0 <= x <= 2147483647 | |
Required, default 5 seconds. For secondary zones, the minimum amount of time between the completion of processing of one notification (serial number testing and/or zone transfer), and the start of processing of another notification. Validation: 0 <= x <= 2147483647 | |
Required, default 1 second. The interval to stagger notification of multiple servers of a particular change. Validation: 0 <= x <= 2147483647 | |
Required, default 5 seconds. The period of time to delay, after an initial zone change, before sending change notification to other name servers. This property allows you to accumulate multiple changes, and limit the number of times the serial number advances. Validation: 0 <= x <= 2147483647 |
To disable NOTIFY for all zones, type:
nrcmd> dns disable notify
You can use IXFR and NOTIFY together, but you do not have to. You might want to disable NOTIFY for a quickly changing zone for which immediate updates on all secondaries does not warrant the constant NOTIFY traffic. This zone might benefit from having a short refresh time and a disabled NOTIFY.
nrcmd> zone example.com set refresh=30m nrcmd> zone example.com disable notify
For more information about setting zone properties, see the "Zone" section later in this chapter.
You can use the set, get, and unset commands to assign and retrieve values from the DNS server's name-value properties.
The syntax is:
dns get prop dns set prop=val [prop=val...] dns unset prop dns show
Table 2-10 lists and describes the DNS properties.
| Property | Description |
|---|---|
Required, default 53. Specifies the UDP and TCP port number on which the DNS server listens for queries. Validation: [1, 65535] | |
Required, default 7 days. Indicates the maximum amount of time that you want Network Registrar to retain cached information. Validation: 0 <= x <= 2147483647 | |
Required, default 200 KB. Indicates the size of the in-memory record cache, in kilobytes. Validation: 0 <= x <= 2147483647 | |
Required, default 10 minutes. Indicates how long information learned from other name servers about nonexistent names or data should be cached. Validation: 0 <= x <= 2147483647 | |
Required. Specifies the UDP and TCP port to which the DNS server sends queries to other servers. Validation: [1, 65535] |
The dns method commands allow you to add, list, or remove specific servers for dealing with root-hint servers, exception servers, and forwarding servers, and for flushing
the cache.
The root hint method allows you to specify the names and addresses of the root servers. After you specify these servers, Network Registrar queries them for their root-name server records, which in turn are used to resolve other names. These values do not need to be exact, but they need to be accurate enough for the Network Registrar DNS server to be able to retrieve the correct information.
The syntax is:
dns addRootHint name addr [addr...] dns removeRootHint name dns listRootHints
To add the root name server a.root-servers.net, type:
nrcmd> DNS addRootHint a.root-servers.net 198.41.0.4
To remove the root name server a.root-servers.net, type:
nrcmd> DNS removeRootHint a.root-servers.net
To list the root name servers, type:
nrcmd> DNS listRootHints
You only need to use the exception method if you do not want your DNS server to use the standard name resolution for querying root name servers for names outside the domain. The exception method allows you to specify the resolution exception domains and the associated servers' IP addresses.
The syntax is:
dns addException name addr [addr...] dns removeException name dns listExceptions
For example, the sample company, QuickExample, has four subsidiaries: red, blue, yellow, and green. Each of them has its own domain under the .com domain. But when users at red.com. want to use resources at blue.com, their DNS server knows that it is not authoritative for blue.com., and attempts to locate blue.com. by asking the root name servers.
To use exception handling, the administrator at red.com. lists all the domains that users might want to access, and at least one corresponding name server. In this case, the administrator would list the three other domains for the QuickExample company.
To add the exception server blue.com., type:
nrcmd> DNS addException blue.com. 192.168.1.4
To remove the name server blue.com., type:
nrcmd> DNS removeException blue.com.
To list the name servers, type:
nrcmd> DNS listExceptions
The forwarder method allows you to specify the addresses of any name servers that you want your Network Registrar DNS server to use as forwarders. Network Registrar forwards recursive queries to these servers before forwarding queries to the Internet. You can use the exception method to override forwarding for specific domains.
The syntax is:
dns addForwarder addr [addr...] dns removeForwarder addr dns listForwarders
To add the forwarder server 192.168.1.4, type:
nrcmd> DNS addForwarder 192.168.1.4
To remove the name server 192.168.1.4, type:
nrcmd> DNS removeForwarder 192.168.1.4
To list the forwarder servers, type:
nrcmd> DNS listForwarders
You can use the dns flushCache command to stop the disk cache file from growing, but the actual behavior depends on whether your DNS server is running or stopped.
To completely clear a cache that has grown too large, stop the server, type the command, and restart the server.
The syntax is:
dns flushCache
The exit command allows you to exit the current nrcmd program session. Network Registrar writes all your unsaved changes to the database. If Network Registrar is unable to save your changes, it displays the same error code as if you had used the save command.
The syntax is:
exit
To quit the Network Registrar command line interface when you are in interactive mode, type exit. For example, to quit, type:
nrcmd> exit
The export command allows you to write the state of all the current leases or the contents of a DNS zone on a specific cluster to a file.
The syntax is:
export leases [file]
export zone zone name[{static | dynamic | both} [file]]
export zonenames [{forward | reverse | both} [file]]
export hostfile [file]
The export command, with the argument leases, writes the state of all the current leases to the output file. For a description of the file format, see the "Dump and Load File Formats" section in the "Codes and Formats" appendix.
For best results you should run the export command when the DHCP server is stopped. Although you can run the export command while the DHCP server is running without any negative effect on the server, if you do you might get some inconsistencies.
The syntax is:
export leases output-file
The output-file is the name of output file or "-" for standard out.
To export the leases to the output file leaseOut, type:
nrcmd> export leases leaseOut
The export command with the argument zone writes the specified DNS zone into a file in the BIND format.
The syntax is:
export zone domain-name output-file arguments
For example, to write the contents of the Example domain, type:
nrcmd> export zone Example.com hosts.local static
The export command with the argument zonenames exports the names of the zones in the server. You can specify forward, reverse, or both to cause the command to export the forward zones, reverse zones, or all the zones, respectively.
The syntax is:
export zonenames {forward | reverse | both} output-file
The export command with the argument hostfile creates a hostfile, in UNIX hostfile format, from all the zones in the server. It ignores reverse zones. It creates hostfile records from A records, CNAME records, and HINFO records. The hostfile record consists of the IP Address, the FQDN, aliases created from the A records and CNAME records, and comments created from HINFO records.
The syntax is:
export hostfile output-file
The extension command allows you to configure and integrate user-written DHCP extensions into the DHCP server.
To extend the DHCP server with an extension, you must do the following:
Step 1 Write the extension in either Tcl, C or C++, and install it in the server extensions directory.
Solaris:
For Tcl, this is /opt/nwreg2/extensions/DHCP/tcl.
For C or C++, this is /opt/nwreg2/extensions/DHCP/dex.
Windows NT:
For Tcl, this is \Network Registrar\registrar\extensions\dhcp\tcl.
For C or C++, this is\Network Registrar\registrar\extensions\dhcp\dex.
It is best to place these extensions in the appropriate directory for TCL or C/C++ extensions. Then, when configuring the filename, type the filename itself (with no / or \).
If you want to place extensions in subdirectories, you must enter the filename with a path separator. These are different depending on the operating system on which your DHCP server is running.
When entering a filename that contains a \ character on Windows NT, you must enter it with a \\ (because \ is an escape character for the Network Registrar CLI). For example, to enter the filename debug\myextension.tcz, enter debug\\myextension.tcl
Step 2 Configure the DHCP server to recognize this extension, using the extension command.
Step 3 Attach the configured extension to one or more DHCP extension points using the dhcp attachExtension command.
For more information about the command, see the "DHCP Extension Commands" section earlier in this chapter. For more information about choosing extensions points and writing extensions, see the "Using Extension Points" chapter.
Step 4 Reload the server.
The syntax is:
extension name create lang file entry [prop=val...] extension name delete extension list
To configure a Tcl extension, type:
nrcmd> extension mytclext create mytclfile.tcl mytclentry
The following is a sample:
proc mytclentry{request response environ}{
$environ log LOG_INFO "helloworld"
{
You can use the set, get, and unset commands to assign and retrieve values from the extension's properties.
The syntax is:
extension name get prop extension name set prop=val extension name unset prop extension name show
Table 2-11 lists and describes the extension properties.
| Property | Description |
|---|---|
Required (set by create), default <none>. The name of the entry point for the module. This function is called from any extension point to which this module is bound. The arguments for this function are server-implementation specific. | |
Required (set by create), default <none>. This filename is relative to the directory extensions in the installation. It cannot be a absolute pathname, nor can it contain any sequence of two dots (..). | |
Optional, default <none>. The arguments that should be passed to the init-entry point function. For more information about how the DHCP server parses this information, see the "Init-Entry Entry Point" section in the "Using Extension Points" chapter. | |
Optional, default <none>. The name of the init-entry point. If you set it, Network Registrar calls this function when the server loads the module and when the server shuts down. For more information about this entry point, see the "Init-Entry Entry Point" section in the "Using Extension Points" chapter. | |
Required (set by create), default <none>. The language in which the extension or module is implemented. Tcl indicates that the module is a Tcl extension (tcl7.5). Dex indicates that the module is a shared object with C calling interfaces. | |
Required (set by create), default <none>. The name of the extension or module. Network Registrar uses this name to assign extensions or modules to extension points. Changing this property renames the extension. |
The nrcmd program uses the same locking mechanism as Network Registrar. When you execute a command, the program attempts to get an exclusive lock for the cluster to which it is connected. If the program is unable to get an exclusive lock, it displays a warning. You can only issue the following commands: client, lease, zone add, help, and force-lock.
The force-lock command obtains an exclusive lock. Use this command with caution, because running more than one program that updates the Network Registrar database can cause database corruption.
If you use the force-lock command to unlock a cluster, the command writes the warning to the log file on the client machine not on the cluster.
To force an exclusive lock, type:
nrcmd> force-lock
You can use the help command to display the nrcmd program's online help.
You can select the sections of the man page output by specifying the section names after the help cmd command. The section names are as follows:
The syntax is:
help help cmd [section...]
To print the list of commands, type:
-> help 100 Ok
To print the contents of the help man page, type:
-> help help 100 Ok
To print the contents of the help command's synopsis, type:
-> help help synopsis
100 Ok
SYNOPSIS
help
help cmd [section...]
Before you can import leases, you must perform several configuration steps:
Step 1 Configure scopes in the DHCP server for the leases that you plan to import.
For more information, see the "Scope" section later in this chapter.
Step 2 If the host names for the leases are to be dynamically entered into DNS as part of the import, configure zones in the DNS server to allow dynamic updates.
For more information, see the "Zone" section later in this chapter.
Step 3 Set the DHCP server to import mode so that it will not respond to other lease requests during the lease importing.
For more information, see the "DHCP" section earlier in this chapter.
After you have imported the leases, take the DHCP server out of import mode so that it can respond to other lease requests.
The syntax is:
import leases file
To import the file LeaseIn to the DHCP server, type:
nrcmd> import leases LeaseIn
If the lease time in the import file is greater than the lease time the client would have received if it were to acquire a lease, the client is given the lesser lease time. For example, suppose it is 2 p.m. and your scope is configured for a one hour lease. According to the file you are importing, the lease time will not expire until 5 p.m. After you import the file, the lease will expire at 3 p.m., not 5 p.m.
If the import file specifies a zone name, the zone name will not be used when DNS is updated. If it specifies a host name, the host name will be used when DNS is updated, unless overridden by a host-name specification in a client or client-class entry.
The only way to indicate to the DHCP server that the client's host name should be placed in a zone other than the default associated with the scope, is to specify that zone in a client or client-class entry.
BIND uses a boot file, called named.boot, to point the server to it database files. You can import your entire BIND configuration by using the import command.
The syntax is:
import named.boot file
To import the file /etc/named.boot to the DNS server, type:
nrcmd> import named.boot /etc/named.boot
You should use UNIX style paths even when running the import command on Windows NT. The previous example on Windows NT might look like this:
nrcmd> import named.boot c:/etc/named.boot
There is one known incompatibility between the way BIND loads named.boot configurations and the way nrcmd loads named.boot configurations.
When a zone file contains an $INCLUDE directive, BIND searches for the include file relative to the directory specified by the directory directive in the named.boot file, and nrcmd searches for the include file relative to the directory containing the zone file being processed.
You can avoid this problem completely if your BIND configuration uses absolute paths whenever specifying an include file in a zone file. If your zone files contain relative paths when specifying include files and the directory containing the zone file is not the same as the directory specified by the directory directive in the named.boot file, your configuration will not load properly. You will need to convert the relative paths in your zone files to absolute paths to import your BIND configuration into Network Registrar. An example of a configuration and how it might be fixed follows.
/etc/named.boot
/usr/local/domain/primary/db.example
/usr/local/domain/primary/db.include
/usr/local/domain/secondary
/etc/named.boot:
# BIND searches for zone files and include files relative to
#/usr/local/domain
directory /usr/local/domain
# BIND finds zone file in /usr/local/domain/primary primary
# end of /etc/named.boot
/usr/local/domain/primary/db.example
# BIND searches for include file relative to /usr/local/domain
$INCLUDE primary/db.include
# end of /usr/local/domain/primary/db.example
To make the configuration loadable, change the relative path in the file db.example to an absolute path:
$INCLUDE primary/db.include
$INCLUDE /usr/local/domain/primary/db.include
Table 2-12 lists and describes all the boot file directives that are supported by the BIND 4.9.6 distribution and the corresponding nrcmd syntax that is generated. Directives that Network Registrar does not support are marked with the word unsupported, and the directives that require no action from Network Registrar are marked with the word none.
| BIND | Nrcmd |
|---|---|
directory new-directory | None---Supported within the named.boot file parser |
include file | None---Supported within the named.boot file parser |
primary domain-name-of-zone file | zone create domain-name-of-zone primary file=file |
secondary domain-name-of-zone ip-addr-list [backup-file] | zone create domain-name-of-zone secondary ip-addr [,ip-addr...] |
forwarders ip-addr-list | dns addForwarder ip-addr [,ip-addr...] |
slave | dns enable slave-mode |
tcplist ip-addr-or-network-list | zone domain-name-of-zone enable restrict-xfer zone domain-name-of-zone set restricted-set= ip-addr [,ip-addr...] |
xfernets ip-addr-or-network-list | zone domain-name-of-zone enable restrict-xfer zone domain-name-of-zone set restricted-set=ip-addr[,ip-addr...] |
max-fetch number | dns set xfer-client-concurrent-limit=number |
domain local-domain-name | Unsupported |
cache domain-name file | Unsupported |
sortlist network-list | Unsupported |
stub domain ip-addr-list [backup-file] | Unsupported |
Bogusns ip-addr-list | Unsupported |
check-names primary/secondary/response fail/warn/ignore | Unsupported |
options forward-only | Dns enable slave-mode |
options no-recursion | Dns enable no-recurse |
options no-fetch-glue | Dns enable no-fetch-glue |
options fake-iquery | None---Network Registrar only supports fake iquery |
options query-log | Unsupported |
limit transfers-in number | dns set xfer-client-concurrent-limit=number |
limit transfers-per-ns number | Unsupported |
limit datasize number | Unsupported |
limit files number | Unsupported |
The ldap command allows you to associate remote LDAP servers with Network Registrar and set their attributes.
The syntax is:
ldap name create hostname [prop=val] ldap name delete ldap list
To create an LDAP server object myserver with a host name of myserver.american.com, type:
nrcmd> ldap myserver create myserver.american.com
To delete an ldap server object myserver, type:
nrcmd> ldap myserver delete
To list the ldap server objects, type:
nrcmd> ldap list
Use the enable, disable, or test commands to enable, disable, or determine whether the feature has been set. After you enable a feature, you can set its properties.
The syntax is:
ldap name disable feature ldap name enable feature ldap name test feature
Table 2-13 lists and describes the LDAP features.
| Feature | Description |
|---|---|
Optional, default false. Enables you to limit the number of outstanding queries to the LDAP server. If you enable this feature you can set the maxprequest property. | |
Optional, default false. Enables you to refine queries to the LDAP server. | |
Optional, default false. Enables you to specify the types of updates to the LDAP server. |
You can use the set, get, and unset commands to assign and retrieve values from the LDAP server's properties.
The syntax is:
ldap name get prop ldap name set [prop=val] ldap name unset property
Table 2-14 lists and describes the LDAP properties.
| Property | Description |
|---|---|
The number of connections that the server should make to a particular LDAP server. This is primarily a performance-tuning parameter. In some cases, more than one connection can improve overall throughput. | |
If the dn (distinguished name) of the LDAP object to update can be constructed from one of the lease attributes, the specified dn-attribute is formatted using the dn-format string to construct the object filter that specifies the LDAP server to be modified. | |
Formats the dn-attribute. A %s is required and is replaced with the value of the dn-attribute. | |
There is a setting called "keep all state" that is controlled by the flags attribute. If the DHCP server is writing lease state into LDAP and this is set, the server will not remove lease data when a lease expires (or is released). | |
The host name of the server to connect to. Network Registrar needs the host name for LDAP servers. | |
The limit on the number of LDAP referrals Network Registrar will follow when querying. A value of zero means "don't follow referrals." | |
Limits any single LDAP connection to this number of outstanding queries. You may choose to limit the number of outstanding queries to improve performance. The DHCP server uses this configuration information when preparing client-entry queries. | |
The password of a user with access to the parts of the directory that DHCP will use. (LDAP servers can be configured to allow anonymous access, so this is optional). | |
The port to connect to. (There is a default.) | |
A positive integer. LDAP servers can be used in preference order: 1 is the highest preference value. | |
The name of the LDAP attribute that may indicate that an LDAP response is a referral. The referral may or may not contain the dn to query for. If the dn is present (the current server assumes this), it is used as the search path along with a wildcard search scope in the query that follows the referral. If not, the search path is built by formatting the data in the referral attribute with the referral filter, and the existing search scope is used. | |
If the referral attribute does not contain a dn, the referral-attribute's data is formatted with this filter expression to build a search path, and the existing search scope for the LDAP server is used. | |
The filter to be applied in the query. A %s is required and is replaced by the value of the dn attribute. | |
The name of an object in the directory to use as a query's starting-point. The path and the scope together control the portion of the directory that are searched. | |
The scope can be SUBTREE (all children of the search path will be searched), ONELEVEL (only one the immediate children of the base object will be searched), or BASE (only the base object will be searched). | |
If the LDAP object's dn cannot be determined directly, the DHCP server must issue a query to retrieve the dn. In that case, the DHCP server uses these parameters to extract the data from a lease attribute (specified by the search-attribute, and format it using the search-filter expression). | |
Formats the update-search-attribute. A %s is required and is replaced with the value of the dn-attribute. | |
The search filter (built using either the dn attribute or the search attribute) is used along with the path and scope to specify the LDAP object that should be updated. | |
The search scope is used to specify the LDAP object that should be updated. | |
The distinguished name of an object with access to the parts of the directory that DHCP will use. (Because you can configure LDAP servers to allow anonymous access, this property is optional.) |
You can use the setEntry, getEntry, and unsetEntry commands to set, query, and clear elements of the various dictionary properties in the LDAP server configuration. These dictionary properties provide a convenient mapping from strings keys to string values.
The syntax is:
ldap name setEntry prop key=value ldap name getEntry prop key=value ldap name unsetEntry prop key
Table 2-15 lists and describes the LDAP dictionary properties.
| Properties | Description |
|---|---|
Controls whether additional LDAP attributes are retrieved along with client-entry attributes. If any of these are present in a query's results, their values are made available to scripts through the request's environment dictionary. The LDAP value is keyed by the value in the LDAP query env-dictionary. | |
Controls the mapping between the names of LDAP attributes and client-entry attributes. The server will attempt to retrieve all of the LDAP attributes specified in the dictionary. When a query succeeds, the values for any LDAP attributes that it returns are set in the corresponding client-entry attributes. | |
The dictionary that maps LDAP attributes to DHCP lease attributes. When an LDAP object is modified, each LDAP attribute that is present in this dictionary is set to the value of its corresponding DHCP lease attribute. |
To configure a query-dictionary to search for the surname (sn) and use its data to specify the client's DHCP host name, type:
nrcmd> ldap dirserver setEntry query-dictionary sn=host-name
To configure a query-dictionary to search for the first name (givenname) to use for the specific client-class name, type:
nrcmd> ldap myserver setEntry query-dictionary givenname=client-class-name
To configure a query-dictionary to search for the localityname to use for the domain name, type:
nrcmd> ldap myserver setEntry query-dictionary localityname=domain-name
The lease command allows you to view and manipulate the current DHCP leases in the cluster.
The syntax is:
lease list lease withMACaddr mac address lease name show lease name activate lease name deactivate lease name force-available lease name macaddr
Table 2-16 lists and describes the lease command actions.
| Action | Description |
|---|---|
Removes the deactivate flag from the lease, but does not change the status of a lease marked as unavailable. | |
Prevents the lease from being given out or renewed, but does not change the state of the lease. | |
Makes a currently held lease available, even a lease marked as unavailable. Because using the force-available action may compromise the integrity of your IP address allocations, make sure that before you use the command the client holding the lease has stopped using the lease. | |
Displays the most recent MAC address associated with this lease. If no MAC address was ever associated with this lease (or if the lease has become unavailable), then Network Registrar displays the error message, "302 Not Found." | |
Displays the lease attributes for a specific address. |
To activate lease 192.168.1.9, type:
nrcmd> lease 192.168.1.9 activate
You can use get to display the values from the lease properties. These properties are read-only.
The syntax is:
lease name get prop
Table 2-17 lists and describes the lease command properties.
| Properties | Description |
|---|---|
The IP address of this lease. | |
The DHCP server attempted (possibly successfully) to enter this name into the DNS server for this client. It is related to the client-host-name, but may not be identical due to name collisions in the DNS server database. | |
The domain name specified (if any) into which to put the client's DNS name. | |
A variety of flags relating to the client. For more information about these flags, see the following section, "Client Flags." | |
The DNS name that the client requested the DHCP server place into the DNS server. | |
The client-id specified by the client, or one synthesized by the DHCP server for this client (if client-id-created-from-mac-address is set in the client-flags). | |
The time at which the client most recently contacted the DHCP server. | |
The MAC address which the client presented to the DHCP server. | |
The time at which the lease will expire. | |
Flags for the lease are either reserved or deactivated. The lease is reserved for some MAC address or the lease is deactivated, which means that it should not be used. Any clients that are using deactivated leases will be NAKed on their next renewal. | |
The time at which the state last changed to its current value. You can use this property to determine when the lease was made unavailable. | |
The current state of the lease. |
You can use the following client flags:
The following flags are for internal use only: client-valid, client-fqdn-present, client-updates-name, clear-host-name, host-name-has-changed, and domain-name-has-changed.
The lease can be in any of the following states:
The license command allows you to specify the license key for a cluster, or to view the license key or the license's expiration date.
Your license key is located on the back of the Cisco Network Registrar 2.0 CD case. Enter the license the first time you configure any cluster.
The syntax is:
license set prop=val license get prop
Table 2-18 lists and describes the license command properties.
| Properties | Description |
|---|---|
The expiration date of the license. The date is read-only. | |
The license key |
To set the license, you must run nrcmd in interactive mode, then exit and rerun nrcmd. To set the license to key 1234 abcd 5678 efgh, type:
nrcmd -C cluster1 -N admin -P changeme nrcmd> license set key=1234-abcd-5678-efgh 100 Ok nrcmd> exit
The listaddr command provides the address utilization reporting functionality of the listaddr.bat command available in earlier versions of Network Registrar. Because the output from this command was designed for analysis tools such as spreadsheets, the formatting is not ideal for end users.
The output for the listaddr command is a series of eight-column, comma-separated rows. There is one row for each known address. (This means that the total output can be quite verbose.) A column may be empty if the usage of that column does not apply to the address. Table 2-19 lists and describes the meanings of the column.
| Column | Description |
|---|---|
1 | IP address in unsigned hexadecimal format. |
2 | IP address in the canonical dotted format. |
4 | DNS name of host, for assigned addresses only. |
5 | State of the address. This field is blank for any address other than those assigned through DHCP leases. The values for such addresses are: Available, Unavailable, Leased, Expired, Deactivated. |
3 | Type of the address. These types are defined as follows: STATIC---Assigned to a host through DNS. DYNAMIC---Assigned to a host through a DHCP lease. UNALLOCATED---The address is in the range of a DHCP scope, but is not in use. RESERVED---The address is reserved for a host through DHCP. |
6 | Native host name, for addresses assigned through a DHCP lease. This is usually the Windows or UNIX name for the host. |
7 | MAC address, for addresses assigned through a DHCP lease. |
8 | Expiration time, for DHCP dynamic addresses |
The syntax is:
listaddr
To run listaddr, type:
nrcmd> listaddr
The policy command allows you to configure DHCP policy configurations. A policy is a collection of DHCP option values that can be associated with a range of addresses in a scope, or with a specific client or client-class configuration.
The syntax is:
policy name create [prop=val] policy name delete policy list
To create the policy CompanyB, type:
nrcmd> policy CompanyB create
You can enable, disable, or determine whether the feature has been set. You use the enable, disable, or test commands.
The syntax is:
policy name enable feature policy name delete feature policy name test
Table 2-20 lists and describes the policy features.
| Property | Description |
|---|---|
Optional, default false. Specifies that leases for this scope should be permanently granted to requesting clients. | |
Optional, default false. Controls whether the server uses the value of its lease time (server-lease-time) to determine the length of the lease. The DHCP server offers clients lease times that reflect the configured lease-time option from the appropriate policy. |
You can use the set and get commands to assign and retrieve values from the policy's properties.
The syntax is:
policy name get property policy name set property=value
Table 2-21 lists and describes the policy properties.
| Property | Description |
|---|---|
Optional, default true. Clients may request a specific lease time. The server will not honor those requested lease times if this attribute is false. The server will not honor a client's lease time if the time is longer than the server's normal lease time. | |
Optional, default <none>. A list of the names of options that should be returned in any replies to BOOTP clients. The options themselves do not have to have been configured in the same policy as the reply-options list; the server will search the hierarchy of policies for each option named in the list. For a description of the options and fields, see the "Configuring a BOOTP Packet" section in the "Configuring Network Registrar" chapter. | |
Optional, default <none>. A list of the names of options that should be returned in any replies to DHCP clients. The options themselves do not have to have been configured in the same policy as the reply-options list; the server will search the hierarchy of policies for each option named in the list. | |
Optional, default 5 minutes. The length of time between the expiration of a lease and the time it is made available for reassignment. | |
Optional, default 2 minutes. If the server offers a lease to a client, but the offer is not accepted, the server will wait the specified number of minutes before making the lease available again. | |
Optional, default <none>. The name of a boot file to be used in a client's boot process. The server returns this filename in the file field of its replies. The packet-file-name cannot be longer than 128 characters. | |
Optional, default <none>. The host name of a server to use in a client's boot process. The server returns this filename in the 'sname' field of its replies. The packet-server-name field cannot be longer than 64 characters. | |
Optional, default <none>. The IP address of the next server in a client's boot process. For example, this might be the address of a TFTP server used by BOOTP clients. The server returns this address in the siaddr field of its reply. | |
Optional, default <none>. The time that the server believes the lease is valid. It may be useful to have the server consider leases leased for a longer period than the client in order to get more frequent client communication along with the stability of long lease times. |
To set the grace period to three days for policy 168.1-net, type:
nrcmd> policy 168.1-net grace-period 3d
You can set individual option values with the setOption command, unset option values with the unsetOption command, and view option values with the getOption and listOptions commands. When you set an option value, the DNS server replaces any existing value or creates a new one, as needed, for the given option name.
The syntax is:
policy name listOptions policy name setOption optname value policy name getOption optname policy name unsetOption optname
Table 2-22 lists and describes the policy options.
| Property | Description |
|---|---|
Lists the options in the named policy. | |
Sets the option name and value to the specified policy. The format is optname value. For example, dhcp-lease-time 3600. | |
Gets the value of the named option. | |
Removes the named option from the specified policy. |
To specify the lease time in a scope, type:
nrcmd> policy 168.1-net setOption dhcp-lease-time 608400
To list the options in a policy, type:
nrcmd> policy 168.1-net listOptions
You can use the setLeaseTime command to set the values of lease times and the getLeaseTime command to display the value of a lease time.
The syntax is:
policy name setLeaseTime value policy name getLeaseTime
The lease time is the value of the dhcp-lease-time option. Specify the time in seconds.
A policy contains two lease times: the client lease time and the server lease time.
You might want to establish these two different lease times if you want to retain information about clients' DNS names and yet have them renew their leases frequently. When you use a single lease time and it expires, the server no longer keeps that client's DNS name. If, however, you use a short client lease time and a longer server lease time, the client information is retained even after the client's lease has expired.
The syntax is:
remote-dns create addr [/maskbits] [prop=val] remote-dns name delete remote-dns list
Table 2-23 lists and describes the remote-dns properties.
| Property | Description |
|---|---|
The address of the server or network to which this information applies. | |
The number of bits in the addr attribute that are significant. |
To create the remote server description 128.103.1.1 with the net mask of 255.255.255.255, type:
nrcmd> remote-dns create 128.103.1.1/32
Each net mask octet is composed of 8 bits. In the example above all 32 bits are significant, and the netmask is 32. If just the first three octets were significant, the net mask would be 24.
You can enable, disable, or determine whether the feature has been set using the enable, disable, or get commands.
remote-dns name disable feature remote-dns name enable feature remote-dns name get feature
Table 2-24 lists and describes the remote DNS server description features.
| Property | Description |
|---|---|
Optional, default false. Indicates whether or not a foreign server supports incremental transfer and should be queried for incremental (IXFR) before full (AXFR) when asking for zone transfers. Although setting ixfr to true is generally harmless, doing so may result in additional transactions to accomplish a zone transfer. | |
Optional, default false. Indicates whether or not a remote server can be sent zone transfers (AXFR) with multiple records in one TCP packet. Older DNS servers will crash when receiving such transfers, despite being allowed by the protocol. |
When you enable or disable incremental transfer, Network Registrar looks for the most specific match, that is, it matches the machine with the longest mask. You can use this feature to specify a group of servers with a single command.
To enable all DNS servers on this network to perform incremental transfer, type:
nrcmd> remote-dns create 128.103.1.0/16 ixfr=true
To disable all DNS servers 128.103.1.1/32 from performing incremental transfers, type:
nrcmd> remote-dns create 128.103.1.1/32 ixfr=false
The save command allows you to validate and save your changes to the database.
The syntax is:
save
The nrcmd program performs validation when you create objects or modify their properties. It checks that you have supplied the required properties and that their values are valid. The program also checks the validity of property values when you set them.
When you enter the save command, Network Registrar performs three levels of validation:
All nrcmd commands return a status code as the first line of output. The status codes are affected by SMTP and other line-oriented protocols. The first word on the line is a three-digit status code, and the remaining output is the descriptive text. The first digit of the status code determines the class of the status.
Table 2-25 lists and describes the save command error codes class status.
| Error Code | Description |
|---|---|
Indicates a successful save. | |
Indicates an error in processing the command. | |
Indicates an error in communicating with the cluster database server. | |
Indicates an internal error in the program. |
For more information about error codes, see the "Error Codes" appendix.
The scope command allows you to create and edit DHCP scopes.
The syntax is:
scope name create addr mask [prop=val] scope name delete scope list
To create, delete, or list scopes, type:
nrcmd> scope testScope create 192.168.1.0 255.255.255.0 nrcmd> scope testScope delete nrcmd> scope list
The scope features allow you to enable, disable, or determine whether the feature has been set. You use the enable, disable, or get commands. The get command displays the value of the feature.
The syntax is:
scope name disable feature scope name enable feature scope name get feature
Table 2-26 lists and describes the scope features.
| Feature | Description |
|---|---|
Optional, default disabled. Controls whether the server accepts BOOTP requests. If you want clients to always receive the same addresses, you need to reserve IP addresses for all your BOOTP clients. For information about how to reserve address, see the "Scope Method Commands" section later in this chapter. | |
Optional, default enabled. Controls whether the DHCP server will accept DHCP requests for this scope. You would only disable DHCP for a scope to cause the scope to be used for BOOTP exclusively, or to temporarily deactivate a scope. | |
Optional, default disabled. Controls whether the server will accept dynamic BOOTP requests for this scope. Dynamic BOOTP requests are BOOTP requests that do not match a reservation, but can be satisfied from the available lease pool. To use this feature, you must also enable bootp. | |
Optional, default disabled. Controls whether the DHCP server should attempt to update a DNS server with the name and address information from leases that are granted to requesting clients. | |
Optional, default disabled. Controls whether the server should attempt to ping an address. | |
Optional, default disabled. Controls whether the DHCP server automatically creates DNS host names for DHCP clients who do not provide names. The server can synthesize unique names for clients based on the synthetic-name-stem property. | |
Optional, default disabled. Controls whether the DHCP server is updated before the lease is granted. |
To enable dynamic DNS update, type
nrcmd> scope testScope enable dynamic-dns
To disable dynamic BOOTP, type
nrcmd> scope testScope disable dynamic-bootp
You can use the set and get commands to assign and retrieve values from the scope command properties.
The syntax is:
scope name set prop=val scope name get prop=val [prop=val...] scope name show
Table 2-27 lists and describes the scope command properties.
| Property | Description |
|---|---|
Optional, default <none>. The address of the subnet for which this scope contains addresses. (Read-only.) | |
Optional, default <none>. A scope that does not extend leases to clients. It treats all of the addresses in its ranges as if they were individually deactivated. | |
Optional, default <none>. The address of the reverse DNS server for the zone into which the server should add PTR records. | |
Optional, default <none>. The name of the inverse (in.addr.arpa) zone that is updated with PTR and TXT records. | |
Optional, default <none>. The IP address of the primary DNS server on which the forward zone resides. | |
Optional, default <none>. The name of the DNS zone to which a DHCP client's host name should be added (A record). | |
Optional, default <none>. The mask associated with the scope's network address. (Read-only.) | |
Optional, default <none>. The number of milliseconds the DHCP server should wait for ping responses. If you make this value too large, you will slow down the lease offering processes. If you make this value too small, you will reduce the effectiveness of pinging addresses before offering them. | |
Optional, default <none>. The name of the policy associated with this scope. | |
Optional, default <none>. The IP address of the primary scope for this (secondary) scope. | |
Optional, default <none>. The subnet mask of this scope's primary scope (if this is a secondary scope). | |
Optional, default <none>. The primary scope for this (secondary) scope. Use the distinguished name none to indicate no primary scope. You need to specify a primary scope if you have multiple logical subnets on the same physical network segment, and if you allow DHCP to offer addresses from any of the subnets. | |
Optional, default <none>. Controls whether to allow existing clients to reacquire their leases, but not to offer any leases to new clients. A renew-only scope will not change the client associated with any of its leases, other than to allow a client currently using an available IP address to continue to use it. | |
Optional, default <none>. The list of selection criteria associated with a scope. The scope compares a client's selection criteria to this list in order to determine whether the client can obtain a lease from the scope. | |
Optional, default <none>. The prefix of the default host name to use if clients do not supply host names. | |
Optional, default <none>. If the server is replying to a BOOTP request, and is offering a lease from a scope that is configured to perform DNS updates, it will check this property before beginning the DNS update. This property allows you to prevent DNS updates for BOOTP clients, while allowing updates for DHCP clients. |
To set the net mask, type:
nrcmd> scope testScope set netmask=255.255.255.0
To set the name of the reverse zone, type:
nrcmd> scope testScope set dns-reverse-zone-name=10.in-addr.arpa.
To get the number of bytes in the DNS host name, type:
nrcmd> scope testScope get dns-host-bytes=100
The scope method commands allow you to add, remove, show, and list ranges and reservations.
You can specify the start and end values as host numbers or IP addresses. The start and end values must fall within the network addresses as defined by the scope's addr and the network mask attributes.
The syntax is:
scope name addRange start end scope name listLeases filter scope name listRanges scope name removeRange start end
Table 2-28 lists and describes the scope range methods.
| Method | Description |
|---|---|
Adds a range of addresses to the named scope. | |
Lists the leases in the named scope. | |
Lists the available addresses in the named scope. | |
Removes the range of available addresses in the named scope. |
To add a range, type:
nrcmd> scope testScope AddRange 192.168.1.10 192.168.1.20
To delete a range, type:
nrcmd> scope testScope removeRange 192.168.1.10 192.168.1.15
The scope command with the name argument allows you to add, delete, or list the reservations on the named scope.
The syntax is:
scope name addReservation ipaddr macaddr
scope name listReservations
scope name removeReservation {ipaddr|macaddr}
Table 2-29 lists and describes the scope reservation methods.
| Method | Description |
|---|---|
Adds the reservation to the named scope. | |
Lists the reservations in the named scope. | |
Deletes a reservation from the named scope. |
To add a reservation, type:
nrcmd> scope testScope AddReservation 192.168.1.10 1,6,00:a0:24:2e:9c:20
To remove a reservation, type the following, specifying either the client's MAC or IP address:
nrcmd> scope testScope removeReservation 192.168.1.10
The scope-selection-tag command allows you to define tags that are added to the scope selection tag list. After you have defined scope selection tags, you can associate them with scopes, clients, and client-classes.
The syntax is:
scope-selection-tag name create scope-selection-tag name delete scope-selection-tag list
To create the scope selection tag internal, type:
nrcmd> scope-selection-tag internal create
To delete the scope selection tag internal, type:
nrcmd> scope-selection-tag internal delete
To list the scope selection tags, type:
nrcmd> scope-selection-tag list
Network Registrar limits you to a total of 30 scope selection tags. When the DHCP server configures itself, it checks the number of scope selection tags defined for any network. A network in this context is the aggregation of all of the scopes that are related to a particular subnet. This includes all of the scopes that belong together (because they share a common network number and subnet mask) and all of the scopes that are related to one of these through the use of the primary scope reference. Within all of the scopes that make up a network, there can be no more than 30 scope selection tags.
When the DHCP server reads a client entry (from the local database or from LDAP), the server checks its scope selection inclusion and exclusion criteria against the scope selection tags defined for the scopes on this network. If the client entry references tags that are not present in any scope in the network, then how the server handles the tags depends on whether the reference is to included or excluded tags. If the reference is for excluded tags, then the tag will have no effect. If the reference is for included tags, then the server determines that there is no acceptable scope on that network for this client.
The server command allows you to affect the behavior of the server. After you have used the server command or any other time you have changed the server's configuration, reload the server. Use the server command or the Network Registrar GUI to reload the server.
The syntax is:
server {DNS|DHCP} cmd
Table 2-30 lists and describes the arguments to the server commands.
| Argument | Description |
|---|---|
Causes the specified server to be stopped and then immediately restarted. When the server restarts it rereads all of its configuration information and its previously saved state information and then begins operating. | |
Starts the specified server, either DNS or DHCP. | |
Stops the specified server, either DNS or DHCP. | |
Gets the specified server's current health. | |
Gets the specified server's current statistics. | |
Sets the debugging level and the location of the debug messages. You can specify either MLOG or WINDOW as locations. The default location is MLOG. | |
Turns off debugging output. |
To stop the DNS server, type:
nrcmd> server DNS stop
To start the DHCP server, type:
nrcmd> server DHCP start
To display the health of the DHCP server, type:
nrcmd> server DHCP getHealth
The server command features allow you to enable or disable a feature. You use the enable or disable commands to affect the following feature.
The syntax is:
server {DNS|DHCP} enable feature
server {DNS|DHCP} disable feature
Table 2-31 lists and describes the server argument.
| Argument | Description |
|---|---|
Controls whether the server is started by the AIC server agent when you reboot. You might want to disable this feature for clusters that want to provide a single protocol service. By default, both the DNS and DHCP servers are enabled. |
To disable the DNS server from automatically restarting on reboot, type:
nrcmd> server DNS disable start-on-reboot
Table 2-32 lists and describes the server properties.
| Property | Description |
|---|---|
The version string for the server. This property is useful when describing version information to Technical Support. |
The session command allows you to set session control parameters on your nrcmd program session. You can control the visibility level that determines which properties are displayed, and the default output format.
The syntax is:
session set prop=val session get prop session show
Table 2-33 lists and describes the session command arguments.
| Argument | Description |
|---|---|
default-format | An enumerated string that can have the following values: script---Displays the objects suitable for script processing, that is, one object per output line. cluster---Displays the name of the current cluster. This is a read-only property. user---Displays the name of the current user. This is a read-only property. |
Controls which properties are displayed. The default visibility is 5. |
To set the output so that it is suitable for script processing, type:
nrcmd> session set default-format=script
The zone command allows you to create and edit DNS zones.
The syntax is:
zone name create primary file=BINDfile zone name create primary ns person [prop=val] zone name create secondary addr [prop=val] zone name delete zone list
To create a zone, type:
nrcmd> zone QuickExample.com create primary file=host.local
To create both an SOA record with values (ns.test.org. andy.test.org.) and an NS record with value ns.test.org, type:
nrcmd> zone test.org create primary ns andy
Both of these records will have the name of the zone test.org. or @). Because the name ns.test.org. is within the test.org. zone, you will have to provide an A record for ns.test.org:
nrcmd> zone test.org. addRR ns A 24.10.2.2
You can enable, disable, or determine the feature that has been set with the enable, disable, or test commands.
The syntax is:
zone name disable feature zone name enable feature zone name test
Table 2-34 lists and describes the zone features.
| Feature | Description |
|---|---|
Required, default enabled (Primary server only.) Enables or disables RFC 2136 dynamic updates to the zone. The most typical source of these updates is a DHCP server. | |
Required, default disabled. Restricts zone transfers to a specific set of hosts. If you restrict zone transfers, you need to use the restricted-set property to list the servers that are allowed to perform zone transfers. | |
Optional, default< none>. Enables requesting incremental transfer for this zone. When set, (to either to true or false) it overrides the global ixfr-enable value for this zone. | |
Optional, default <none>. Enables the notification of other authoritative servers when this zone changes. When set, (to either true or false) it overrides the global notify value for this zone. |
Using the server global value (not setting this value per-zone) gives you an easy way of globally turning IXFR on or off, or setting a general policy for your zones and specific exceptions to the server global value.
You can use the set and get commands to assign and retrieve values from the zone's properties. These properties depend on the type of zone that you are creating.
The syntax is:
zone name set prop=val [prop=val...] zone name get property
Table 2-35 lists and describes the primary zone create properties.
| Property | Description |
|---|---|
(Secondary-only.) The list of servers from which Network Registrar will transfer data for this zone. | |
The set of IP addresses from which dynamic updates will be accepted, when you have enabled the dynamic feature. The nrcmd program treats addresses with zeroes in the least significant octets as network numbers, with implicit masks in octet multiples. | |
Optional, default: 604800) The expire interval, in seconds, of the zone. The length of time a secondary can continue to serve zone data without confirmation that it is still current. Validation: refresh < x < 2147483647 | |
Optional, default: 86400) The minimum TTL value to expose in resource records for this zone. Records with lower TTL values will be published with this value. Validation: 0 <= x <= 2147483647 | |
An optional list of additional servers to notify when this zone changes. All servers listed in NS records for the zone with the exception of the server described by the ns property of the zone (the mname field of the SOA record) will receive notifications. Servers listed in the notify-list will also be notified. | |
Required, default: <none>).The fully qualified domain name of the primary for this zone. This host is the original or primary source of data for this zone. | |
Required, default: <none>). A domain name which specifies the mailbox of the person responsible for this zone. The first label is a user or mail alias, the rest of the labels are a mail destination. A mailbox of hostmaster@test.com would be represented as hostmaster.test.com. | |
Optional, default: 10800. The refresh interval, in seconds, of the zone. Used by secondaries as the period of polling for zone changes. Validation: 1 <= x <= 2147483647 | |
The set of IP addresses that may request zone transfers when you have enabled the restrict-xfer feature. | |
Optional, default: 3600. The retry interval, in seconds, of the zone. Used by secondaries as the period of retrying when polling for changes, or attempting zone transfer encounters errors. Validation: < (expire - refresh) | |
Optional, default: 1. The current serial number of the zone. Maintained automatically by the DNS server. Validation: 0 <= x <= 4294967295 |
You use the following commands to add, remove, and list the hosts for the zone.
The syntax is:
zone name addHost hostname addr [alias...] zone name removeHost name zone name listHosts
Table 2-36 lists and describes the host properties.
| Property | Description |
|---|---|
name | The host's domain name. |
addr | The list of addresses assigned to the host. |
aliases | An optional list of alias domain names for this host. |
To add a host to the QuickExample zone, type:
nrcmd> zone QuickExample.com addHost bethpc 192.168.1.10
You use the following commands to add, remove, and list the resource records in the zone.
The syntax is:
zone name addRR name [ttl] [class]type data
zone name removeRR name type data
zone name listRR {all|static|dynamic}
Table 2-37 lists and describes the resource record properties.
| Property | Description |
|---|---|
The resource record's domain name (owner name). | |
The type of resource record, such as PTR or A. | |
The class of resource record, which is always IN (for Internet) in DNS. | |
The resource record time to live (in seconds). The length of time the record the client may cache the resource record. |
To add a name server resource record, type:
nrcmd> zone QuickExample.com addRR ns green
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Thu Jul 13 11:14:37 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.