Отсюда: http://www.webhostingtalk.com/showthread.php?t=625723
Вот быстрый Perl-скрипт, который требует Net :: DNS (довольно распространенный модуль).
#!/usr/bin/perl
# Domains Available
# Josh Skidmore <josh@vorcado.com>
# 05 August 2007 | 11:40p EST
# Requirements
use Net::DNS;
# Variables
%VAR = (
db => './domains.txt',
);
# Open file
open (DB,$VAR{'db'});
my (@domains) = <DB>;
close (DB);
# Test domains
foreach my $domain (@domains)
{
chomp($domain);
my ($available) = &check_domain(domain => $domain);
if ($available)
{
print "$domain is available.<br />\n";
}
else
{
print "$domain is NOT available<br />\n";
}
}
sub check_domain {
# Test domain for existance
# Josh Skidmore <josh@vorcado.com>
# 05 August 2007 | 11:42p EST
# Variables
my (%DATA) = @_ ;
my ($available) = 0;
# Start Net::DNS
my $res = Net::DNS::Resolver->new;
$res->udp_timeout(2);
$res->tcp_timeout(2);
my ($domain) = $res->search($DATA{'domain'});
if ($domain)
{
($available) = 1;
}
# Output
return ($available);
}