How to check if a domain name is available (in bulk)?

I am looking to do a bulk search of a domain name to find out if some domain names are available for purchase. I could not find the perl module, but there seems to be a way in perl to do this. I am looking for something for free. THX!

+3
source share
3 answers

From here: http://www.webhostingtalk.com/showthread.php?t=625723

Here is a quick Perl script that requires Net :: DNS (a fairly general module).

#!/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);
}
+1
source

CPAN whois- . Net::Whois::Parser , .

Prevents the command from being whoisavailable on Linux and other Unix-y systems (including Cygwin for Windows). There's also a Perl script on CPAN . Running these programs is the easy part. The tricky part that Perl can definitely help with is analyzing the output from these programs. whois

+1
source

Source: https://habr.com/ru/post/1788676/


All Articles