#!/usr/bin/perl # ======================================================= # WhoDomLite V1.0 # Written by Mark Lovick February 2001 # Copyright WJC Internet 2001 # Unauthorised use of this script is strictly prohibited # ======================================================= # INSTALLATION # # + This version of WhoDomLite must be uploaded to your # UNIX/LINUX or NT/WIN2000 server in ASCII format. # + Make sure you are running Perl5 or greater # + Make sure the first line in this script points to your # Perl interpreter e.g. #!/usr/local/bin/perl or # #!/usr/bin/perl or #!/usr/sbin/perl (ask your ISP) # ======================================================= sub head { # ================================== # ======================================================= # PLACE THE TOP OF YOUR HTML PAGE HERE: ================= # ======================================================= print qq~ iMarque high quality website and graphic design service based in Lincolnshire UK



Domain name registration is not expensive and if you are serious about your web presence allow us to help you choose the right name for your domain.

We will advise on all aspects of the registration process and potential future consequences and opportunities available to you. You can register as many domain names as you wish for both proactive marketing and defensive business reasons. Lateral thinking on our part should ensure we find suitable unregistered names for your use.

Name recognition plays a powerful part in drawing traffic to your site and makes it easier for potential customers or visitors to remember your site address.

If you wish to search for a domain you might be interested in, use our domain search facility below.



~; # ======================================================= # END OF HEADER ========================================= # ======================================================= } sub foot { # ============================= # ======================================================= # PLACE THE BOTTOM OF YOUR HTML PAGE HERE: ============== # ======================================================= print qq~

iMarque
Greetwell Place
2 Limekiln Way
Greetwell Road
Lincoln
LN2 4US

Tel: 01522 546050
Fax: 01522 880260
Email:
info@imarque.com

about
websites
e-commerce
domains and hosting
graphic design and print
promotional cd's
portfolio
contact

~; # ======================================================= # END OF FOOTER ========================================= # ======================================================= } # ================================================== # This script is provided without warranty. By using this # script you agree to indemnify M.Lovick of any damages # or losses of any kind that may arise from the use of this # script. # # YOU MUST NOT CHANGE ANY OF THE CODE BELOW. # We only allow you to use this script FREE OF CHARGE if # you provide a link back to our home page. Many hours # of development has gone into this release so it is the # least you can do. # # THANKYOU FOR USING WhoDomLite # # WhoDomLite must only be downloaded/ditributed through # http://www.noc2.com/ if you were able to download this # script elsewhere then please inform mlovick@noc2.com # # ======================================================= use IO::Socket; &parse; my $action = $form{'action'}; my $dom = "\L$form{'dom'}"; my $whois_server = $form{'dispWhois'}; print "Content-type: text/html\n\n"; &head; print qq~
Search for your Domain here
~; if (!$action) { print qq~
Query A Domain

Enter a domain to search for in the field below. You can search any or all of the extensions by selecting/deselecting the checkboxes.

WWW.

.com .net .org .co.uk .org.uk

~; } if ($action eq 'search') { print "
Query Results

Thankyou for using our domain search. We have pleasure in presenting you with the results below. Search Again.

\n"; foreach $tld (@tlds) { if ($tld =~ /.uk/) { $whois_server = "whois.nic.uk"; } elsif ($tld =~ /uk./) { $whois_server = "whois.nomination.net"; } else { $whois_server = "whois.crsnic.net"; } $flag = ''; &whois; foreach $line (@out) { if ($line =~ /No match for/) { $flag++ } if ($line =~ /Whois Server/) { chomp $line; ($junk,$USwhois) = split(/\: /,$line); } } if ($USwhois) { $dispWhois = "\L$USwhois"; $USwhois = ''; } else { $dispWhois = $whois_server; } if ($flag) { print "$dom.$tld is AVAILABLE

\n"; } else { print qq~ $dom.$tld is not available View Whois

\n~; } } print "

\n"; } if ($action eq 'display') { $tld = $form{'ext'}; if (&whois) { print qq~
This is the raw whois output provided by $whois_server for the domain: $dom.$tld Search Again

@out
~; } else { print "ERROR - Whois server $whois_server not working!\n"; } } # End action display. sub whois { $socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$whois_server",PeerPort=>'43',); if ($socket) { print $socket "$dom" . ".$tld" . "\015\012"; @out = <$socket>; close $socket; } } sub parse { my($in, @in, $entry, $var, $val); $in = $ENV{'QUERY_STRING'}; @in = split(/\&/, $in); foreach $entry (@in) { $entry =~ s/\+/ /g; ($var, $val) = split(/=/, $entry, 2); $var =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; $val =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; $form{$var} = $val; if ($var eq 'tld') { $tlds .= "$val:"; } } @tlds = split(/\:/,$tlds); } print qq~
WhoDomLite v1.0 © Copyright M.Lovick 2001
~; &foot;