whois -h whois.member.denic.de -- -C ISO-8859-1 -T dn,ace Test12345678901234567890123456789012345678901234567890.de
1
2
3
$ (echo '-C ISO-8859-1 -T dn,ace Test12345678901234567890123456789012345678901234567890.de';sleep 3) | socat stdio tcp:whois.denic.de:43
Domain: test12345678901234567890123456789012345678901234567890.de
Status: free
1
2
3
4
$ perl -MIO::Socket::INET -e 'my $s=IO::Socket::INET->new("whois.denic.de:43"); print $s "-C ISO-8859-1 -T dn,ace foertsch.de\r\n"; print while(<$s>)'
% Copyright (c) 2010 by DENIC
% Version: 2.0
...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl ########################################################################### use strict; use IO::Socket; my $domain = 'selfhtml.org'; my $ip = gethostbyname($domain); # 32 bit network order #$ip = inet_ntoa($ip); $ip = join(".", unpack('CCCC', $ip)); # same as above ;) binmode STDOUT; my $sock = IO::Socket::INET->new('whois.publicinterestregistry.net:whois') or die "no socket"; print "\n======= DENIC ==========================\n"; print $sock "$domain\n"; print $_ while <$sock>; print "\n======= RIPE ===========================\n"; $sock = IO::Socket::INET->new('whois.ripe.net:whois') or die "no socket"; print $sock "$ip\n"; print $_ while <$sock>;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use IO::Socket;
local ($hSocket);
local (@asWhoIsOutput);
eval
{
$hSocket = IO::Socket::INET->new(Proto => "tcp",
Timeout => "10",
PeerAddr => $sWhoIsHost,
PeerPort => "43");
if ($hSocket)
{
$hSocket->autoflush(1);
@asWhoIsOutput = <$hSocket>;
close ($hSocket);
}
};
if(@asWhoIsOutput)
{
for (@asWhoIsOutput)
{
print $_;
}
}