<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks for the replies. Normally, I would indeed use zone transfers to pull data in a standard format. However, for my current task, this is not an option.</div><div class=""><br class=""></div><div class="">I ended up solving the aging values problem using shell commands to strip this easily-identifiable data from the source files. I then (temporarily) solved the WINS problem by hacking Net::DNS::ZoneFile::<span style="font-family: Menlo; font-size: 11px;" class="">_getRR to skip WINS records.</span></div><div class=""><span style="font-family: Menlo; font-size: 11px;" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> $line = $self->_getline if $line =~ /\s<span style="font-variant-ligatures: no-common-ligatures; color: #ffffff; background-color: #000000" class="">WINS</span>\s/;</div></div><div class=""><br class=""></div><div class="">Perhaps in the future I will add a Net::DNS::RR::WINS package to better account for this, but I don't have time for that right at the moment.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Chris</div><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 27, 2014, at 4:52 AM, tlhackque <<a href="mailto:tlhackque@yahoo.com" class="">tlhackque@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" class="">
<div text="#000000" bgcolor="#FFFFFF" class="">
<div class="moz-cite-prefix">On 27-Oct-14 00:02, Chris Buxton wrote:<br class="">
</div>
<blockquote cite="mid:%3C54A46235-2FB4-4AAD-BE47-58365F2402B4@buxtonfamily.us%3E" type="cite" class="">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" class="">
Hi,
<div class=""><br class="">
</div>
<div class="">I'm trying to parse MS DNS zone files using
Net::DNS::Zonefile, but it's having issues with two non-standard
Microsoft additions to the format:</div>
<div class=""><br class="">
</div>
<div class="">1. Age values. For example:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">_kerberos._tcp.direktion._sites.dc._msdcs
[AGE:3627351] 600 SRV 0 100 88 <a moz-do-not-send="true" href="http://atzt0009.at.zurich.com/" class="">atzt0009.at.zurich.com</a>.</div>
</div>
<div class=""><br class="">
</div>
<div class="">2. WINS records. For example:</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">@ 0 WINS L2 C900 (</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">
192.168.47.221</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">
192.168.47.222 )</div>
</div>
<div class=""><br class="">
</div>
<div class="">I don't actually need these data points. I just need
to have Net::DNS::ZoneFile::read not fail (return null) when
encountering them. I have a lot of this data, such that it would
be painful to rely on manual remediation. Does anyone have any
ideas?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Chris Buxton</div>
</blockquote>
<br class="">
I'm not an MS DNS admin expert - perhaps there's an 'export a
standard zonefile' utility somewhere. A quick search didn't turn
one up, but I may have missed it.<br class="">
<br class="">
One approach is to use axfr() instead of reading the file. You can
tell the MS server not to transfer these records - there's a 'do not
repicate this record' checkbox somewhere. See
<a class="moz-txt-link-freetext" href="http://technet.microsoft.com/en-us/library/cc784258(v=ws.10).aspx">http://technet.microsoft.com/en-us/library/cc784258(v=ws.10).aspx</a>.<br class="">
<br class="">
Or you can use Dick's approach and trap the exception - though I'd
match for these cases on the error string in case you trip on
another error from time to time.<br class="">
<br class="">
I'd use axfr() if possible - that's the standard API to DNS. M$
extensions are always a moving target. At least you can beat them
up if that's broken.<br class="">
<br class="">
If axfr() isn't allowed from the hosting server, or if these files
aren't served by one: I might even go as far as running a private M$
server with read-only access to these zone files, on a non-standard
port rather than forcibly read the files...<br class="">
<br class="">
I really, really don't like chasing M$... <br class="">
<br class="">
If at some point you need the WINS/WINS-R records, it wouldn't be
hard to write a Net::DNS class for them. You might suggest an API
for registering a private class so that you don't have to patch the
dispatch hash. Then you could submit it to CPAN - assuming the
Net::DNS folks don't take it.<br class="">
<br class="">
Hmm, looks like a 5cent response to a 1cent question. Oh, well.<br class="">
<br class="">
Good luck.<br class="">
<br class="">
<pre class="moz-signature" cols="72">--
This communication may not represent my employer's views,
if any, on the matters discussed.
</pre>
</div>
_______________________________________________<br class="">net-dns-users mailing list<br class=""><a href="mailto:net-dns-users@nlnetlabs.nl" class="">net-dns-users@nlnetlabs.nl</a><br class="">https://www.nlnetlabs.nl/mailman/listinfo/net-dns-users</div></blockquote></div><br class=""></body></html>