5 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl -w use Net::DNS; my $domain = $ARGV[0] || die "usage: $0 domain"; my $resolver = new Net::DNS::Resolver; # MX-Record abfragen my @mxrecs = mx($resolver, $domain); if (@mxrecs) { # Gefunden! foreach $rec (@mxrecs) { print $rec->preference, " ", $rec->exchange, "\n"; } } else { # Leere Liste, Fehler! print "Kein MX-Record für $domain: ", $resolver->errorstring, "\n"; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/perl -w use strict; use Net::DNS; my $domain_file = $ARGV[0]; die "usage: $0 domainfile" unless( $domain_file and -e $domain_file ); my $resolver = new Net::DNS::Resolver; open my $fh, '<', $domain_file or die $!; while( my $domain = <$fh> ){ chomp $domain; # MX-Record abfragen my @mxrecs = mx($resolver, $domain); if (@mxrecs){ # Gefunden! foreach my $rec (@mxrecs){ print $rec->preference, " ", $rec->exchange, "\n"; } } else{ # Leere Liste, Fehler! print "Kein MX-Record für $domain: ", $resolver->errorstring, "\n"; } }
renee+2008-01-30 10:00:59--Code (perl): (dl )die "usage: $0 domainfile" unless( $domain_file and -e $domain_file );
5 Einträge, 1 Seite |