File: trace_dns.pl

package info (click to toggle)
libnet-dns-perl 0.59-1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 828 kB
  • ctags: 400
  • sloc: perl: 6,650; sh: 220; ansic: 101; makefile: 60
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);