Update missing PTR records

Discussion in 'DNS Server' started by Bob, Jun 12, 2007.

  1. Bob

    Bob Guest

    The reverse zone for an address range was not created at the start. I need to
    programatically update the reverse zone if possible from the existing forward
    zone, any suggestions?
     
    Bob, Jun 12, 2007
    #1
    1. Advertisements

  2. Bob

    Herb Martin Guest

    There is NO relationship between forward and reverse zones in DNS
    itself -- the only such relationship is in the minds of admins like us.

    So you will need to script this if you wish to do something like this,
    perhaps
    using DNSCmd to first dump the list of forward records and then (after
    any post-processing) using that list to script in the changes to the reverse
    zone.

    You can use /enumrecords to get the list of records:

    dnscmd /enumrecords learnquick.com .

    (that's a "."-dot on the end there since you must give the starting node)

    Problem is this gets ALL records so you have to send it through Grep,
    Awk, Sed, Perl, etc or edit the result by hand:

    I don't usually use FindStr (prefering a good Grep or Perl but I have
    approximated the FindStr to strip the unnecessary lines (only close
    because FindStr is giving me unpredictable results):

    dnscmd /enumrecords learnquick.com . | findstr /r "^[a-z].* +A +[0-9.]+$"

    Once you have the list of records you can pump them through a DNSCmd
    /RecordAdd with one (or two) for..in..do loops. You will need two if you
    don't have another way to differentiate dynamic records (with an Aging:
    parameter) from Static records AND if you want to check both.
     
    Herb Martin, Jun 12, 2007
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.