How to find free domain name

Posted by root Fri, 22 Feb 2008 21:23:00 GMT

#!/usr/bin/perl

use strict;
use warnings;

my $dom = shift || die "missing name\n";
my $res = qx{whois $dom};

die $1 . "for '$dom'\n" if $res =~ /(no\s+whois\s+server\s+)/i;
die "$dom is free\n"    if $res =~ /no\s+match|does\s+not\s+exist/i;
die "$dom is reserved\n";

__END__
_whois 123456.com
123456.com is reserved

_whois _123456_.com
_123456_.com is free

Posted in ,  | Tags  | no comments