<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eugene,<br>
<br>
I'd suggest some shell-scripting to do the trick<br>
<br>
Create a file containing the zones the check. One zone per line, in the
sample below I've used the name 'zonelist'. Then execute the following
script:<br>
<br>
for zone in `cat zonelist`; do dig @xxx.xxx.xxx.xxx $zone AXFR >
/tmp/$zone.$$; zone2sql --gmysql --zone=/tmp/$zone.$$; rm
/tmp/$zone.$$; done<br>
<br>
This dumps all sql-commands to your tty. Redirecting output to a file
gives you the possibility to execute the sql-script using mysql.<br>
<br>
If you want to keep the dig-output just remove the 'rm /tmp/$zone.$$'.
Beware, running the script again creates all zone-files again in /tmp!<br>
<br>
Ton<br>
<br>
Eugene Pefti schreef:
<blockquote cite="mid:021701c8a511$9085bd10$b1913730$@net" type="cite">
<pre wrap="">Thanks Ton, I figured it too. How would you suggest to use zone2sql to get
rid of the second SOA RR?
Eugene
-----Original Message-----
From: Ton van Rosmalen [<a class="moz-txt-link-freetext" href="mailto:ton@netbase.nl">mailto:ton@netbase.nl</a>]
Sent: Wednesday, April 23, 2008 12:08 AM
To: Eugene Pefti
Cc: <a class="moz-txt-link-abbreviated" href="mailto:pdns-users@mailman.powerdns.com">pdns-users@mailman.powerdns.com</a>
Subject: Re: [Pdns-users] Duplicate SOA while using dig and zone2sql
Hi Eugene,
Eugene Pefti schreef:
</pre>
<blockquote type="cite">
<pre wrap="">Can anybody tell me why this doesn't work:
#dig axfr domain.tld @xxx.xxx.xxx.xxx | zone2sql --gmysql --zone=- | mysql
-u root -D pdns
I do exactly what is said in pdns documentation, my problem is --zone=- is
not understood just because "-" option doesn't work.
</pre>
</blockquote>
<pre wrap=""><!---->----------------------------------------------------------------------------
</pre>
<blockquote type="cite">
<pre wrap="">-
died because of STL error: Unable to open file '-': No such file or
directory
</pre>
</blockquote>
<pre wrap=""><!---->----------------------------------------------------------------------------
</pre>
<blockquote type="cite">
<pre wrap="">-
</pre>
</blockquote>
<pre wrap=""><!---->I've checked the source-code (latest svn-version and the one I use
myself) and as far as I can tell no
code is available to handle the special case of 'zone=-'.
Zone2sql just tries to 'fopen' the filename and throws an error because
it can't open '-'. Perhaps STL
should handle the special filename but I'm not familiar enough with STL
to answer that question.
</pre>
<blockquote type="cite">
<pre wrap=""><snip>
</pre>
</blockquote>
<pre wrap=""><!---->
So it looks like the documentation is ahead of the code in this case.
Kind regards,
Ton
</pre>
</blockquote>
</body>
</html>