modifying dns zone TTL

Discussion in 'Perl Misc' started by herbert.burnswell@gmail.com, May 5, 2012.

  1. Guest

    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
     
    , May 5, 2012
    #1
    1. Advertising

  2. Uri Guttman Guest

    >>>>> "hb" == herbert burnswell <> 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
     
    Uri Guttman, May 5, 2012
    #2
    1. Advertising

  3. On 2012-05-04 23:21, <> 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.
    | | | |
    __/ | http://www.hjp.at/ | -- Bill Code on
     
    Peter J. Holzer, May 6, 2012
    #3
  4. Guest

    On Friday, May 4, 2012 4:21:12 PM UTC-7, 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, 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
     
    , May 9, 2012
    #4
  5. Herb,

    what is it that you actually want to do?

    Incrementing or what?

    el


    On 2012-05-09 01:03 , 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
     
    Dr Eberhard W Lisse, May 9, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jibba Jabba

    Mass updating of dns zone files

    Jibba Jabba, Aug 28, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,127
    Jibba Jabba
    Aug 28, 2003
  2. Wade.Beasley
    Replies:
    2
    Views:
    415
    Wade.Beasley
    May 10, 2004
  3. =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=

    prevent a postback when moving web parts from zone to zone.

    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    601
    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=
    Feb 8, 2006
  4. Suresh
    Replies:
    0
    Views:
    557
    Suresh
    Jun 2, 2006
  5. Wade.Beasley

    Help! Problem Try to Create DNS Zone entry in Production

    Wade.Beasley, May 8, 2004, in forum: ASP .Net Security
    Replies:
    2
    Views:
    157
    Wade.Beasley
    May 10, 2004
Loading...

Share This Page