Re: Mass Update of DNS Records

This is a discussion on Re: Mass Update of DNS Records within the Bind Users forums, part of the DNS and Related Forums category; Barry Margolin <barry.margolin@level3.com> wrote: > In article <bilren$2a1g$1@sf1.isc.org>, &...


Go Back   Usenet Forums > DNS and Related Forums > Bind Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-29-2003
phn@icke-reklam.ipsec.nu
 
Posts: n/a
Default Re: Mass Update of DNS Records

Barry Margolin <barry.margolin@level3.com> wrote:
> In article <bilren$2a1g$1@sf1.isc.org>, <phn@icke-reklam.ipsec.nu> wrote:
>>Jake <jake@dontmailme.coma> wrote:
>>> I need to change the IP address of about 200 DNS records and also increase
>>> the serial number by one for each. Is there a script out there to do this?

>>
>>> Basically I need it done like this:

>>
>>> 1) Look through all zone files for IP address X

>>
>>> 2) If IP address X found, replace it with Y

>>
>>> 3) Increment serial number for this record

>>
>>
>>Using 'vi' will take an hour and a half. It would take me more time
>>to find a scripting solution then to "just do it".


> But the time spent is more interesting. All that repetitive editing is
> tedious.


> It can actually be done with a Perl one-liner if you follow a regular
> commenting convention for the serial number line


> perl -p -i.bak -e 's/\bX.X.X.X\b/Y.Y.Y.Y/'; s/\d+/$&+1/e if /; serial/' db.*


> Replace '; serial' with whatever comment you put on the serial number line.


> --
> Barry Margolin, barry.margolin@level3.com
> Level(3), Woburn, MA
> *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
> Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


I'm impressed. ( i'll save this for future use.) Thanks Barry !


--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:02 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0