Skip to content

Commit

Permalink
Merge pull request #120 from hookol/rr-type
Browse files Browse the repository at this point in the history
Added flag for Resource Record Type
  • Loading branch information
gamelinux committed Mar 25, 2021
2 parents 09181df + d68a5c5 commit d757713
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
57 changes: 57 additions & 0 deletions pdns.patch
@@ -0,0 +1,57 @@
--- search-pdns-original.pl 2017-08-24 19:18:52.859541254 -0400
+++ /usr/local/bin/search-pdns.pl 2018-03-21 14:49:24.217877474 -0400
@@ -18,6 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ----------------------------------------------------------------------
+# Added Resource Record Type : PJN 20180321

use strict;
use warnings;
@@ -40,7 +41,7 @@

=head1 VERSION

- 0.1.0
+ 0.1.1

=head1 SYNOPSIS

@@ -50,6 +51,7 @@

-s : %IP/Domain%
-r : Enables raw search
+ -t : Resource Record Type (A, NS, MX, SOA, etc.)
--first-seen : Date to search from in iso format (2010-01-01 etc.)
--last-seen : Date to search to in iso format (2020-01-01 etc.)
--limit : Limit on search results (100)
@@ -73,6 +75,7 @@
our $FROM_DATE;
our $TO_DATE;
our $LIMIT;
+our $TYPE;

GetOptions(
'd=s' => \$DEBUG,
@@ -81,6 +84,7 @@
'first-seen=s' => \$FROM_DATE,
'last-seen=s' => \$TO_DATE,
'limit=s' => \$LIMIT,
+ 't=s' => \$TYPE,
);

if ($SEARCH eq "") {
@@ -131,6 +135,13 @@
}
}

+
+if (defined $TYPE) {
+ $QUERY1 = $QUERY1 . qq[AND maptype = '$TYPE' ];
+ $QUERY2 = $QUERY2 . qq[AND maptype = '$TYPE' ];
+}
+
+
$QUERY = $QUERY1 . qq[ UNION ] . $QUERY2;

if (defined $LIMIT && $LIMIT =~ /^([\d])+$/) {
13 changes: 12 additions & 1 deletion tools/search-pdns.pl
Expand Up @@ -18,6 +18,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ----------------------------------------------------------------------
# Added Resource Record Type : hookol 20180321

use strict;
use warnings;
Expand All @@ -40,7 +41,7 @@ =head1 NAME
=head1 VERSION
0.1.0
0.1.1
=head1 SYNOPSIS
Expand All @@ -50,6 +51,7 @@ =head1 SYNOPSIS
-s : %IP/Domain%
-r : Enables raw search
-t : Resource Record Type (A, NS, MX, SOA, etc.)
--first-seen : Date to search from in iso format (2010-01-01 etc.)
--last-seen : Date to search to in iso format (2020-01-01 etc.)
--limit : Limit on search results (100)
Expand All @@ -73,6 +75,7 @@ =head1 SYNOPSIS
our $FROM_DATE;
our $TO_DATE;
our $LIMIT;
our $TYPE;

GetOptions(
'd=s' => \$DEBUG,
Expand All @@ -81,6 +84,7 @@ =head1 SYNOPSIS
'first-seen=s' => \$FROM_DATE,
'last-seen=s' => \$TO_DATE,
'limit=s' => \$LIMIT,
't=s' => \$TYPE,
);

if ($SEARCH eq "") {
Expand Down Expand Up @@ -131,6 +135,13 @@ =head1 SYNOPSIS
}
}


if (defined $TYPE) {
$QUERY1 = $QUERY1 . qq[AND maptype = '$TYPE' ];
$QUERY2 = $QUERY2 . qq[AND maptype = '$TYPE' ];
}


$QUERY = $QUERY1 . qq[ UNION ] . $QUERY2;

if (defined $LIMIT && $LIMIT =~ /^([\d])+$/) {
Expand Down

0 comments on commit d757713

Please sign in to comment.