File: trace_dns.pl

package info (click to toggle)
libnet-dns-perl 0.63-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 836 kB
  • ctags: 425
  • sloc: perl: 6,796; sh: 109; ansic: 104; makefile: 59
file content (21 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/local/bin/perl

use strict;
use warnings;

use Net::DNS;
use Net::DNS::Resolver::Recurse;

my $res = Net::DNS::Resolver::Recurse->new;


$res->recursion_callback(sub {
	my $packet = shift;
	
	$_->print for $packet->additional;
	
	printf(";; Received %d bytes from %s\n\n", $packet->answersize, $packet->answerfrom);
});


$res->query_dorecursion(@ARGV);