<script language="perlscript" runat="server">
use IO::Socket;
sub ErrorReport(){
$Response->Write("Cannot connect!"
;
$Response->end;
}
sub whois {
my ($domain, $server) = @_;
my $returnString="";
my $remote=new IO::Socket::INET(
Proto => "tcp",
PeerAddr => "$server",
PeerPort => "whois(43)",
) or die ErrorReport;
$remote->autoflush(1);
print $remote "$domain\n" . $BLANK;
while ( <$remote> ) {
$returnString.=$_;
}
close $remote;
$returnString;
}
</script>
<%
domain=Request("domain"
if domain & "" = "" then
domain="enter-domain-here.com"
end if
%>
<head>
<title>Whois Utility -- ASP and PerlScript!</title>
</head>
<body>
<h1>Whois Utility</h1>
<p>Use this page to look up a domain name in the internic database,
or any of the listed databases. Have fun!
<p>
<form action="inc-whois.asp">
<table>
<tr>
<td align="right">Enter domain to search for:</td>
<td><input name="domain" type="text" value="<% =domain %>" size="25">
<input type="submit" value="Look up domain"></td>
</tr>
<tr>
<td align="right">Select a WHOIS database:</td>
<td><select name="db" size="1">
<option value="rs.internic.net" selected>The InterNIC
(rs.internic.net)
<option value="whois.arin.net">American Registry for Internet
Numbers (whois.arin.net)
<option value="whois.ripe.net">European IP Address Allocations
(whois.ripe.net)
<option value="whois.apnic.net">European IP Address Allocations
(whois.apnic.net)
<option value="whois.nic.mil">US Military (whois.nic.mil)
<option value="whois.nic.gov">US Government (whois.nic.gov)
</select></td>
</tr>
</table>
</form>
<%
if Request("domain"
& "" <> "" then
strDomain=Request("domain"
strDB=Request("db"
strOutput="<br><br><hr><br><pre>" & _
whois(strDomain,strDB) & "</pre>"
Response.Write strOutput
end if
%>
</body>
</html>
this is what we will convert to clientside
use IO::Socket;
sub ErrorReport(){
$Response->Write("Cannot connect!"
$Response->end;
}
sub whois {
my ($domain, $server) = @_;
my $returnString="";
my $remote=new IO::Socket::INET(
Proto => "tcp",
PeerAddr => "$server",
PeerPort => "whois(43)",
) or die ErrorReport;
$remote->autoflush(1);
print $remote "$domain\n" . $BLANK;
while ( <$remote> ) {
$returnString.=$_;
}
close $remote;
$returnString;
}
</script>
<%
domain=Request("domain"
if domain & "" = "" then
domain="enter-domain-here.com"
end if
%>
<head>
<title>Whois Utility -- ASP and PerlScript!</title>
</head>
<body>
<h1>Whois Utility</h1>
<p>Use this page to look up a domain name in the internic database,
or any of the listed databases. Have fun!
<p>
<form action="inc-whois.asp">
<table>
<tr>
<td align="right">Enter domain to search for:</td>
<td><input name="domain" type="text" value="<% =domain %>" size="25">
<input type="submit" value="Look up domain"></td>
</tr>
<tr>
<td align="right">Select a WHOIS database:</td>
<td><select name="db" size="1">
<option value="rs.internic.net" selected>The InterNIC
(rs.internic.net)
<option value="whois.arin.net">American Registry for Internet
Numbers (whois.arin.net)
<option value="whois.ripe.net">European IP Address Allocations
(whois.ripe.net)
<option value="whois.apnic.net">European IP Address Allocations
(whois.apnic.net)
<option value="whois.nic.mil">US Military (whois.nic.mil)
<option value="whois.nic.gov">US Government (whois.nic.gov)
</select></td>
</tr>
</table>
</form>
<%
if Request("domain"
strDomain=Request("domain"
strDB=Request("db"
strOutput="<br><br><hr><br><pre>" & _
whois(strDomain,strDB) & "</pre>"
Response.Write strOutput
end if
%>
</body>
</html>
this is what we will convert to clientside