Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > modifying dns zone TTL

Reply
Thread Tools

modifying dns zone TTL

 
 
herbert.burnswell@gmail.com
Guest
Posts: n/a
 
      05-04-2012
Hi All,

I'm looking to write a perl script to edit TTL's in zone files. Ideally, I'd like to write it as:

../script -f <filename> <newTTL>

and

../script -d <directoryname> <newTTL>

to either edit just one file or all files in a directory.

I've installed and read the perldoc information on DNS::ZoneParse but still don't see how to set it up to edit the TTL.

Questions:

- Is DNS::ZoneParse indeed the best way to obtain the desired functionality or is there a better way to do this?

- Does anyone have a code snippet that they've used to edit TTL's?

Any guidance is greatly appreciated.

TIA,

Herb
 
Reply With Quote
 
 
 
 
Uri Guttman
Guest
Posts: n/a
 
      05-05-2012
>>>>> "hb" == herbert burnswell <(E-Mail Removed)> writes:

hb> I'm looking to write a perl script to edit TTL's in zone files.
hb> Ideally, I'd like to write it as:

hb> ./script -f <filename> <newTTL>

hb> and

hb> ./script -d <directoryname> <newTTL>

hb> to either edit just one file or all files in a directory.

as a start, look at edit_file in File::Slurp on cpan. it makes it easy
to edit any file with one call. so if that dns module works for you on a
string in ram, it will be easy to write the whole thing.

uri
 
Reply With Quote
 
 
 
 
Peter J. Holzer
Guest
Posts: n/a
 
      05-06-2012
On 2012-05-04 23:21, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
> I'm looking to write a perl script to edit TTL's in zone files. Ideally, I'd like to write it as:
>
> ./script -f <filename> <newTTL>
>
> and
>
> ./script -d <directoryname> <newTTL>
>
> to either edit just one file or all files in a directory.


Not a direct answer to your question, but it may simplify the problem:

If you want all the records in the zone file to have the same TTL,
add a $TTL directive at the top and omit the TTL in the individual
records.

hp


--
_ | Peter J. Holzer | Deprecating human carelessness and
|_|_) | Sysadmin WSR | ignorance has no successful track record.
| | | (E-Mail Removed) |
__/ | http://www.hjp.at/ | -- Bill Code on (E-Mail Removed)
 
Reply With Quote
 
herbert.burnswell@gmail.com
Guest
Posts: n/a
 
      05-09-2012
On Friday, May 4, 2012 4:21:12 PM UTC-7, (E-Mail Removed) wrote:
> Hi All,
>
> I'm looking to write a perl script to edit TTL's in zone files. Ideally, I'd like to write it as:
>
> ./script -f <filename> <newTTL>
>
> and
>
> ./script -d <directoryname> <newTTL>
>
> to either edit just one file or all files in a directory.
>
> I've installed and read the perldoc information on DNS::ZoneParse but still don't see how to set it up to edit the TTL.
>
> Questions:
>
> - Is DNS::ZoneParse indeed the best way to obtain the desired functionality or is there a better way to do this?
>
> - Does anyone have a code snippet that they've used to edit TTL's?
>
> Any guidance is greatly appreciated.
>
> TIA,
>
> Herb




On Friday, May 4, 2012 4:21:12 PM UTC-7, (E-Mail Removed) wrote:
> Hi All,
>
> I'm looking to write a perl script to edit TTL's in zone files. Ideally, I'd like to write it as:
>
> ./script -f <filename> <newTTL>
>
> and
>
> ./script -d <directoryname> <newTTL>
>
> to either edit just one file or all files in a directory.
>
> I've installed and read the perldoc information on DNS::ZoneParse but still don't see how to set it up to edit the TTL.
>
> Questions:
>
> - Is DNS::ZoneParse indeed the best way to obtain the desired functionality or is there a better way to do this?
>
> - Does anyone have a code snippet that they've used to edit TTL's?
>
> Any guidance is greatly appreciated.
>
> TIA,
>
> Herb


Hi,

Thanks for the replies... I am investigating the suggestions and will have to figure out what works best for my needs. I was hoping this might be a bit more straight forward than it appears to be.

Thanks again,

Herb
 
Reply With Quote
 
Dr Eberhard W Lisse
Guest
Posts: n/a
 
      05-09-2012
Herb,

what is it that you actually want to do?

Incrementing or what?

el


On 2012-05-09 01:03 , (E-Mail Removed) wrote:
[...]
>
> Hi,
>
> Thanks for the replies... I am investigating the suggestions and will have to figure out what works best for my needs. I was hoping this might be a bit more straight forward than it appears to be.
>
> Thanks again,
>
> Herb



--
If you want to email me, replace nospam with el
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TTL Vs P-TTL (and everything about Flash) RiceHigh Digital Photography 1 09-12-2006 12:18 PM
i-TTL vs D-TTL ( 2nd post) antonius Digital Photography 1 02-07-2004 06:00 PM
Nikon i-TTL / D-TTL antonius Digital Photography 2 02-05-2004 11:34 PM
Olympus E-10 TTL vs Canon E-TTL Patrick L. Digital Photography 3 08-22-2003 05:46 PM
Does SC-12 TTL Flash cable - for Nikon F3, provide full TTL flash capability with newer Nikon units like SB-80 ? H. Brinkman Digital Photography 0 08-09-2003 10:15 AM



Advertisments