You can find a nice Whois Server list on Github
Add Using statement:
Global Declarations:
Form Load Event:
Tetxbox 2 Keypress Event:
Add Using statement:
Code
using System.Net;
using System.Net.Sockets;Global Declarations:
Code
public string whois_server;
public int whois_port;
public TcpClient client;
public string dns_qry;Form Load Event:
Code
whois_port = 43;
whois_server = textBox1.Text;
dns_qry = string.Empty;Tetxbox 2 Keypress Event:
Code
switch ((Keys)e.KeyChar)
{
case Keys.Enter:
client = new TcpClient();
textBox3.Text = "";
client.Connect(whois_server, whois_port);
dns_qry = textBox2.Text + "\r\n";
byte[] qry_bytes = Encoding.ASCII.GetBytes(dns_qry.ToCharArray());
Stream dns_strm = client.GetStream();
dns_strm.Write(qry_bytes, 0, qry_bytes.Length);
StreamReader rdr = new StreamReader(dns_strm, Encoding.ASCII);
while (rdr.ReadLine() != null)
{
textBox3.Text += rdr.ReadLine() + Environment.NewLine;
}
rdr.Close();
dns_strm.Close();
client.Close();
break;
}

