<!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 text="#000000" bgcolor="#ffffff">
    On 09/11/2010 14:14, Michelle Konzack wrote:
    <blockquote cite="mid:20101109141404.GI5441@michelle1" type="cite">
      <pre wrap="">Hello Matus UHLAR - fantomas,

Am 2010-11-09 14:13:47, hacktest Du folgendes herunter:
</pre>
      <blockquote type="cite">
        <pre wrap="">I am not sure whether dnswalk over whole internet can do that, but on your
</pre>
      </blockquote>
      <pre wrap="">
I will try it...

</pre>
      <blockquote type="cite">
        <pre wrap="">server you can either run recursive grep over named data directory, or dump
the named dsatabase and grep it...
</pre>
      </blockquote>
      <pre wrap="">
This is what I currently do...

----[ '/usr/sbin/get_hosts_in cname' ]----------------------------------
#!/bin/sh

QUERY="$1"

for FILE in $(cd /etc/bind && ls *.signed)
do
  grep --regexp=" IN CNAME .*${QUERY}" /etc/bind/${FILE} 2>/dev/null |cut -d ' ' -f1 |sed 's|.$||'
done
------------------------------------------------------------------------

...and it is to slow do to more then  80.000  Zones  (they  have  to  be
greped all) number of VHosts.

Oh, it is now time to use "xargs", because I saw today, that I  hit  the
limits for "ls".  :-D

Following is working:
    cd /etc/bind && ls

but not:
    cd /etc/bind && ls *
or
    cd /etc/bind && ls *.signed

and the OSes are called Linux and BSD...  WTF?

It seems that a commandline can not have more then 31.000 characters.
(no not options but total lenght)

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

</pre>
    </blockquote>
    The asterisk causes the shell to expand the names and run ls with
    them as a single command, so in effect you have "ls file1 file2
    file3 ...".   Try the following instead:<br>
    <br>
    <pre wrap="">cd /etc/bind
for FILE in *.signed
do
  grep --regexp=" IN CNAME .*${QUERY}" ${FILE} 2>/dev/null |cut -d ' ' -f1 |sed 's|.$||'
done</pre>
    It might still have the same issue, but worth a go.<br>
    <br>
    I assume the command length is also why your not simply running
    "grep -h <expression> *.signed"?<br>
    <br>
    Stace<br>
    <blockquote cite="mid:20101109141404.GI5441@michelle1" type="cite">
      <pre wrap=""></pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
bind-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/bind-users">https://lists.isc.org/mailman/listinfo/bind-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>