Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

NSI-style WHOIS Module?

by kleinbiker7 (Sexton)
on Apr 10, 2003 at 19:07 UTC ( #249712=perlquestion: print w/replies, xml ) Need Help??

kleinbiker7 has asked for the wisdom of the Perl Monks concerning the following question:

Hey guys, We want to install a Perl WHOIS module on our UNIX servers, but we need to find out what version of WHOIS it is using. The WHOIS on our UNIX box does not give the data for some of our domains, for example:
whois : : No match for "TRAC.ORG". : :
However, if you go to and type in, it gives me the complete info on the nameservers.

Also, is the one for the same as the one on, which has changed to

Therefore, I want to know if any of Perl's WHOIS modules use the networksolutions version. And if not, is the internic one just as good? Thanks!


Replies are listed 'Best First'.
Re: What WHOIS module do I need to parallel the version on
by phydeauxarff (Priest) on Apr 10, 2003 at 19:57 UTC
    I have had the most consistent results from Net::Whois::Raw

    Best of all, it's trivial to use.

    #!/usr/bin/perl use Net::Whois::Raw; my $s= whois(''); print "result $s\n";

    update...corrected typo. Thanks VSarkiss

Re: What WHOIS module do I need to parallel the version on
by defyance (Curate) on Apr 10, 2003 at 19:56 UTC
    From what I can see Net::XWhois is what you want, it allows you to specify a server to query. Net::Whois appears to use internic for its queries. Both modules are available on cpan. As far as your questions about the different servers, I couldn't tell you, I have no knowledge about them.


    -- Can't never could do anything, so give me and inch, I'll make it a mile.

Re: What WHOIS module do I need to parallel the version on
by sutch (Curate) on Apr 10, 2003 at 19:56 UTC
    I've had success using Net::XWhois.


    use Net::XWhois; $whois = new Net::XWhois( 'Server' => '' ); $whois->lookup( 'Domain' => '' ); print $whois->response();
Re: What WHOIS module do I need to parallel the version on
by Wonko the sane (Deacon) on Apr 11, 2003 at 00:25 UTC
    Just for the heck of it, here is a quick and dirty whois.
    This is more or less probably what Net::Whois::Raw does.
    It of course is alot better and what you should probably consider using.

    This method gets undesired results back from certain TLD whois servers.
    Basically because some expect the search to be specified slightly different.

    #!/usr/local/bin/perl5.6.0 -w use strict; use IO::Socket; while ( my $domain = <> ) { chomp($domain); my($tld) = $domain =~ /\.([^\.]+)$/; my $SOCK = IO::Socket::INET->new( PeerAddr => qq{$}, PeerPort => 43, Timeout => 10, ) or die qq{[$domain] Can't connect to whois server: $!}; print $SOCK qq{$domain \015\012}; print <$SOCK>; close $SOCK; sleep(1); }


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://249712]
Approved by LAI
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2021-12-02 23:15 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (27 votes). Check out past polls.