In this article we are going to create a whois lookup client application. The main aim of this application will be to look up information about websites on various known WHOIS servers.
procedure TForm1.g_infoClick(Sender: TObject); begin memo1.Clear; //label1.Caption:='Connected';
with IdWhois1 do begin Host :=cb.text; memo1.Lines.Text := whois(trim(hname.text)); end;
//idWhois1.Disconnect;
end;
procedure TForm1.resolveClick(Sender: TObject); var Count: Integer; DNSServer: String; HostName: String; I: Integer; begin Memo1.Lines.Clear; DNSServer:=dns.Text; HostName:=hostnme.Text; if (DNSServer='')or(HostName='') then begin Memo1.Lines.Add('*** Error ***'); if DNSServer='' then Memo1.Lines.Add('DNS Server is empty.'); if HostName='' then Memo1.Lines.Add('Host name is empty.'); Exit; end; IdDNSResolver.Host:=DNSServer; IdDNSResolver.QueryType:=[qtA]; IdDNSResolver.Resolve(HostName); Count:= IdDNSResolver.QueryResult.Count; if Count=0 then Exit; for I:=0 to Count-1 do begin if IdDNSResolver.QueryResult.Items[I] is TARecord then li:=lv.Items.Add; with TARecord( IdDNSResolver.QueryResult[I]) do begin //Memo1.Lines.Add(ClassName+': '+Name+' resolves to IP address '+IPAddress); li.Caption:=Name; li.SubItems.Add(IPaddress); end; end; end; end.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.