Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

NSI-style WHOIS Module?

by kleinbiker7 (Sexton)
on Apr 10, 2003 at 19:07 UTC ( [id://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 trac.org : : No match for "TRAC.ORG". : :
However, if you go to http://www.networksolutions.com/cgi-bin/whois/whois and type in trac.org, it gives me the complete info on the nameservers.

Also, is the one for networksolutions.com the same as the one on whois.internic.net, which has changed to

http://www.internic.net/whois.html

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!

Robert

Replies are listed 'Best First'.
Re: What WHOIS module do I need to parallel the version on http://www.networksolutions.com/cgi-bin/whois/whois
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('beesley.org'); print "result $s\n";

    update...corrected typo. Thanks VSarkiss

Re: What WHOIS module do I need to parallel the version on http://www.networksolutions.com/cgi-bin/whois/whois
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.

    HTH!

    -- 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 http://www.networksolutions.com/cgi-bin/whois/whois
by sutch (Curate) on Apr 10, 2003 at 19:56 UTC
    I've had success using Net::XWhois.

    Try:

    use Net::XWhois; $whois = new Net::XWhois( 'Server' => 'whois.networksolutions.com' ); $whois->lookup( 'Domain' => 'trac.org' ); print $whois->response();
Re: What WHOIS module do I need to parallel the version on http://www.networksolutions.com/cgi-bin/whois/whois
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{$tld.whois-servers.net}, 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); }

    Wonko

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-19 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found