Cisco Systems Dial NMS manual Using a Batch File to Make Changes to a DNS Configuration

Models: Dial NMS

1 132
Download 132 pages 47.44 Kb
Page 95
Image 95
Using a Batch File to Make Changes to a DNS Configuration

Task 6—Managing IP Addresses by Using DNS

About Managing IP Addresses

Using a Batch File to Make Changes to a DNS Configuration

CNR can use batch files to make large and small-scale changes to the DNS configuration within your network.

To use the batch-file facility to add and remove entries, follow these steps:

Step 1 Define the batch file by entering zone commands:

zone the.net. addRR doc-core-02 A 172.21.10.6 zone the.net. addRR doc-core-03 A 172.21.10.7

zone 10.21.172.in-addr.arpa. removeRR 6 PTR unused-6.the.net. zone 10.21.172.in-addr.arpa. removeRR 7 PTR unused-7.the.net. zone 10.21.172.in-addr.arpa. addRR 6 PTR doc-core-02.the.net. zone 10.21.172.in-addr.arpa. addRR 7 PTR doc-core-03.the.net. server dns reload

The previous batch-file example shows how to add two new device/IP addresses. In addition to adding two “A” records (lines 1 and 2), remove the “unused” PTR records from the reverse zone (lines 3 and

4)before adding the new “PTR” records, in place of the unused records, to the reverse zone (lines 5 and

6). See line 7 to reload the DNS server.

Step 2

Run the script by using the -boption:

 

 

 

nrcmd>

-b < 172.21.10.batch

 

 

 

 

The following output appears:

 

 

 

 

nrcmd>

 

 

 

 

 

 

zone the.net. addRR doc-core-02 A 172.21.10.6

 

 

100

Ok

 

 

 

 

 

 

doc-core-02

IN

A

172.21.10.6

 

nrcmd>

 

 

 

 

 

 

zone the.net. addRR doc-core-03 A 172.21.10.7

 

 

100

Ok

 

 

 

 

 

 

doc-core-03

IN

A

172.21.10.7

 

nrcmd>

 

 

 

 

 

 

zone 10.21.172.in-addr.arpa. removeRR 6 PTR unused-6.the.net.

 

100

Ok

 

 

 

 

 

 

removing 6

 

IN

PTR

unused-6.the.net.

 

nrcmd>

 

 

 

 

 

 

zone 10.21.172.in-addr.arpa. removeRR 7 PTR unused-7.the.net.

 

100

Ok

 

 

 

 

 

 

removing 7

 

IN

PTR

unused-7.the.net.

 

nrcmd>

 

 

 

 

 

 

zone 10.21.172.in-addr.arpa. addRR 6 PTR doc-core-02.the.net.

 

100

Ok

 

 

 

 

 

 

6

 

 

IN

PTR

doc-core-02.the.net.

 

nrcmd>

 

 

 

 

 

 

zone 10.21.172.in-addr.arpa. addRR 7 PTR doc-core-03.the.net.

 

100

Ok

 

 

 

 

 

 

7

 

 

IN

PTR

doc-core-03.the.net.

 

nrcmd>

 

 

 

 

 

 

server

dns reload

 

 

 

 

 

100

Ok

 

 

 

 

 

Basic Dial NMS Implementation Guide

'#

Page 95
Image 95
Cisco Systems Dial NMS manual Using a Batch File to Make Changes to a DNS Configuration