#!/usr/bin/perl use strict; use warnings; my $tmp_file = './tmp.txt'; my $dns_list_file = './dns.txt'; my $quick_test_file = './quick.txt'; my $test_clock = 0.15; my ( $handle, $list, $hash, $ax, $ip, $i, $j ); sub delay { select( undef, undef, undef, shift ); } print "\nDNS-SERVERLISTE ONLINE AKTUALISIEREN...\n"; system( "wget -nv https://www.ungefiltert-surfen.de/nameserver/ch.txt -O $tmp_file" ); system( qq[cat $tmp_file > $dns_list_file] ); system( qq[echo >> $dns_list_file] ); system( "wget -nv https://www.ungefiltert-surfen.de/nameserver/de.txt -O $tmp_file" ); system( qq[cat $tmp_file >> $dns_list_file] ); system( qq[echo >> $dns_list_file] ); system( "wget -nv https://www.ungefiltert-surfen.de/nameserver/at.txt -O $tmp_file" ); system( qq[cat $tmp_file >> $dns_list_file] ); system( qq[echo >> $dns_list_file] ); system( "rm -f $tmp_file" ); open ( $handle, "<", $dns_list_file ); @$list = <$handle>; close ( $handle ); chomp ( @$list ); @$list = grep( /.*\..*/, @$list ); # doppelte IP's kicken %$hash = map { $_, [] } @$list; @$list = keys( %$hash ); ####### # QUICKTEST FOR ALL SERVERS ########################### $i = $#$list + 1; print "QUICKTEST BEI $i DNS-SERVERN DURCHFÜHREN...\n"; system ( "rm -f $quick_test_file" ); $j = 1; for $ip ( @$list ){ print "Teste DNS-Server $j von $i: $ip\n"; system( "./dig-it.pl $ip www.google.com --quick >> $quick_test_file &" ); $j++; last if $j>30; delay( $test_clock ); } do { delay( $test_clock * 2 ); my $ps = qx[ps ax | grep dig-it.pl | grep -v grep]; $list = [ split( /\n/, $ps ) ]; $i = $#$list + 1; print "Warte auf $i DNS-Server...\n"; } while ( $i );