Elijah_A has asked for the wisdom of the Perl Monks concerning the following question:
Anyone here worked on dns zonefiles? I need some advice... I have some scripts that poll our dns frontend database for updated/new/deleted dns entries. They grab 'em just fine and dump them all together in a temporary file.
I need to be able to update the main zonefile using the temporary file. But everytime the script polls and dump more dns updates to temp, there may be a problem of adding (updated)duplicate entries to the main zonefile.
The old entries in the main zonefile must be updated, but how do I do that? I tried a variety of modules (DNS::Zone::File) but I couldn't get them to work right.
Here's a sample entry from the temp file:
There are hundreds of these entries in one zonefile, I simply need to find specific entries from the main zonefile to be updated. I can't just keep appending to it, duplicates might sneek in.
Elijah
Update: I've decided to use Net::DNS::ZoneFile(I'd have some use for the temp file with this) and hash as one of the monks suggested. But I'm having some trouble printing the objects using Net::DNS::ZoneFile.
I need to be able to update the main zonefile using the temporary file. But everytime the script polls and dump more dns updates to temp, there may be a problem of adding (updated)duplicate entries to the main zonefile.
The old entries in the main zonefile must be updated, but how do I do that? I tried a variety of modules (DNS::Zone::File) but I couldn't get them to work right.
Here's a sample entry from the temp file:
; The Foreign Service Institute ; Created by GovPh: Thu Aug 5 07:51:07 2004 fsi IN NS tayxxxn.ino.com.ph IN NS monumxxo.ino.com.ph IN NS tayxxxn.ino.com.ph IN NS monumxxo.ino.com.ph IN NS tayxxxn.ino.com.ph IN NS monumxxo.ino.com.ph
There are hundreds of these entries in one zonefile, I simply need to find specific entries from the main zonefile to be updated. I can't just keep appending to it, duplicates might sneek in.
Elijah
Update: I've decided to use Net::DNS::ZoneFile(I'd have some use for the temp file with this) and hash as one of the monks suggested. But I'm having some trouble printing the objects using Net::DNS::ZoneFile.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing Zonefiles
by greenFox (Vicar) on Aug 05, 2004 at 06:35 UTC | |
by gellyfish (Monsignor) on Aug 05, 2004 at 11:33 UTC | |
by Elijah_A (Novice) on Aug 05, 2004 at 06:52 UTC | |
by greenFox (Vicar) on Aug 05, 2004 at 07:27 UTC | |
by Elijah_A (Novice) on Aug 05, 2004 at 07:39 UTC | |
Re: Parsing Zonefiles
by bgreenlee (Friar) on Aug 05, 2004 at 06:44 UTC | |
by Elijah_A (Novice) on Aug 05, 2004 at 07:05 UTC | |
by hmerrill (Friar) on Aug 05, 2004 at 11:41 UTC | |
Re: Parsing Zonefiles
by fokat (Deacon) on Aug 05, 2004 at 17:36 UTC | |
by Elijah_A (Novice) on Aug 06, 2004 at 02:43 UTC | |
Re: Parsing Zonefiles
by tomhukins (Curate) on Aug 05, 2004 at 17:00 UTC | |
Re: Parsing Zonefiles
by Elijah_A (Novice) on Aug 06, 2004 at 06:24 UTC | |
by fokat (Deacon) on Aug 10, 2004 at 05:39 UTC |
Back to
Seekers of Perl Wisdom