Function to check the given domain actually exists or not.
private bool isRealDomain(string hostname)
bool isReal = false;
IPHostEntry IPhst = Dns.GetHostEntry(hostname);
IPEndPoint endPt = new IPEndPoint(IPhst.AddressList, 25);
Socket s = new Socket(endPt.AddressFamily,SocketType.Stream, ProtocolType.Tcp);
isReal = true;
catch (<specific exceptions here>)
Just a sample. Need to modified depend on requirement.
Just a normal software developer who love to write code. Developing professional software since 1999. After working in the software industry for many years, I've started my own website to share knowledges and experiences.