Created
January 21, 2015 10:10
-
-
Save nicomen/c4a0668a007eb7d07da0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -wl | |
use Net::DNS; | |
use Modern::Perl; | |
use Time::HiRes qw(tv_interval gettimeofday); | |
my @domains = ('perl.org','cpan.org','perlmonks.org','perlfoundation.org','perlweekly.com','perlbuzz.com','perlsphere.net', 'brukere.startsiden.no', 'www.abcnyheter.no'); | |
my @servers = ('77.40.177.113', '195.159.0.100', '195.159.0.200'); | |
my $res=Net::DNS::Resolver->new; | |
while(1) { | |
foreach my $server (@servers) { | |
$res->nameservers($server); | |
foreach my $domain(@domains){ | |
my $t0 = [gettimeofday]; | |
my $answer = $res->search("$domain"); | |
my $int = tv_interval($t0); | |
print join " ", ($int > 1 ? " SLOW! " : ""), $int, $answer->answerfrom, $answer->answersize, "$domain:", map { $_->address } grep { $_->type eq "A" } $answer->answer; | |
} | |
sleep 0.01; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment