|
|
Simple Whois Processing
Whois Processing is a method of accessing the Internic data base to check the status of a proposed domain name. Your clients may want to know whether a domain name is available, or has already been registered. This tutorial shows how to use a whois HTML page and accompanying cgi program to create an attractive web page that allows users to check for themselves.
-
Make the Web Page
Below is a sample HTML layout that will do the job, in conjunction with a cgi program (explained shortly). You can copy this directly from the page you are viewing or download it, as will be explained in a later step.
<html>
<head>
<title>Domain Name Check</title>
</head>
<body>
<h2><u>Domain Name Check</u></h2>
Use the following form to check the availability of a domain name.
Please provide a value for a domain name and select one of the
extensions, ".com", ".net", or ".org". A query will be performed
on <a href="http://rs.internic.net">InterNIC Registration Services</a>
database.
<p>
<ul>
<form method="POST" action="/cgi-bin/whois.pl">
<table border = 0 bgcolor="#cccccc"><tr><td>
<table border = 1 bgcolor="#cccccc"><tr><td>
<table cellpadding = 3 border = 0 bgcolor="#cccccc">
<tr>
<td valign = bottom>
<font size="+1">Domain Name:</font><br>
<input name="domain" size=20 maxlength=256>
</td>
<td valign = bottom align = center>
<font size="+3">.</font>
</td>
<td align = left rowspan = 2 valign=top>
<font size="+1">
<input type="radio" name="root" value="com" CHECKED> com<br>
<input type="radio" name="root" value="net"> net<br>
<input type="radio" name="root" value="org"> org
</font>
</td>
</tr>
<tr>
<td colspan = 2>
<input type="submit" value="Check name">
<input type="reset" value="Clear">
</td>
</tr>
</table>
</td></tr></table>
</td></tr></table>
<p>
</form>
</ul>
<p>
</body>
</html>
Note that the method is POST and that the action is /cgi-bin/whois
.pl. This means that when the form is completed, it will cause the execution of the cgi program called whois.pl and this program must be in your cbi-bin directory for the form to be processed correctly.
-
The CGI Program
The second component needed is the cgi program. You can view it here. The source code was written by Rus Berrett and is released to the general public. You can copy it from this web page or follow the installation step for it detailed below.
-
Install Components
Now install the components we have described.
Make sure you install all of them and that you place them in the correct
locations.
- Download the HTML Source
You will need to download the HTML Source
and place it on your web server. Feel free to add your own graphics or
to change the wording to suit your company's needs. However, be sure not to
change the variable names for the input fields or else the
form will not work correctly.
- Obtain the CGI programs
Actually two cgi programs are needed, the main one whois.pl (shown earlier) and a helper program util.pl. Below you are shown how to obtain them, depending on whether you are a customer or not.
Customers
-
Login in to your account.
-
Change directories to your cgi-bin directory.
-
Type "tar -xvf /usr/local/contrib/whois.tar"
Other (Then Sign Up)
-
Download the the source code files and place them in your
cgi-bin directory.
-
Make sure to make then executable by using the chmod command
Type "chmod 755 whois.pl util.pl"
Feel free to change the form and add graphics and links. You can
also add other fields and adjust whois.pl and util.pl to properly process the fields.
- Try it!
Now load the sample web page in your browser and check it out! If there are remaining questions please contact our support staff for assistance.
Here is a working example
|
|
See also
Example online form
|