<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 27-Oct-14 00:02, Chris Buxton wrote:<br>
</div>
<blockquote
cite="mid:%3C54A46235-2FB4-4AAD-BE47-58365F2402B4@buxtonfamily.us%3E"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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>
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>
<br>
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>
<br>
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>
<br>
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>
<br>
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>
<br>
I really, really don't like chasing M$... <br>
<br>
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>
<br>
Hmm, looks like a 5cent response to a 1cent question. Oh, well.<br>
<br>
Good luck.<br>
<br>
<pre class="moz-signature" cols="72">--
This communication may not represent my employer's views,
if any, on the matters discussed.
</pre>
</body>
</html>