I want to create whois class like that
public class DomainInfo
{
public string NameServer {get;set;}
public string CreationDate {get;set;}
public string UpdatedDate {get;set;}
public string ExpirationDate {get;set;}
public string Status {get;set;}
public string RegistrantName {get;set;}
public string RegistrantOrganization {get;set;}
public string Registrantemail {get;set;}
public static DomainInfo Parse(string inputData)
{
......
}
}
But I have some problems because different DNS servers return different answers and it’s a very difficult task to parse returned answers. How can this be done?
Here is a link to a blog post with some C# code that might help:
http://blog.flipbit.co.uk/2009/06/querying-whois-server-data-with-c.html
You could probably tweak the parsing code as you run into instances where you are not getting the data you need but I don’t think there is a one shoe fits all solution.