modifying dns zone TTL

  • Thread starter herbert.burnswell
  • Start date
H

herbert.burnswell

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
 
U

Uri Guttman

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
 
P

Peter J. Holzer

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
 
H

herbert.burnswell

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 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
 
D

Dr Eberhard W Lisse

Herb,

what is it that you actually want to do?

Incrementing or what?

el


On 2012-05-09 01:03 , (e-mail address removed) wrote:
[...]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top