diff --git a/dns/check.pl b/dns/check.pl index 53563a1..e51e391 100644 --- a/dns/check.pl +++ b/dns/check.pl @@ -1,4 +1,5 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl +use warnings; use strict; use Net::DNS; @@ -7,6 +8,13 @@ sub usage { exit(1); } +my $verbose; + +if (($ARGV[0] || '') eq '-v') { + $verbose = 1; + shift @ARGV; +} + usage() unless (@ARGV == 1); # generic resolver @@ -57,6 +65,7 @@ sub check_ptr { return; } for my $name (@names) { + print "I: [$addr] -> $name\n" if $verbose; check_a($name, $addr); } } @@ -92,6 +101,7 @@ sub check_a { return; } for my $addr (@addrs) { + print "I: $name -> [$addr]\n" if $verbose; check_ptr($addr, $name); } }