I think you are talking about getting a top level domain name from a host name? TLDs are just the last two parts separated by periods in the full host name, so the function will look like this:
public static string GetTopLevelDomain(string hostName)
{
int lastDot = hostName.LastIndexOf('.');
if (lastDot < 0)
return hostName;
int previousDot = hostName.LastIndexOf('.', lastDot - 1);
return (previousDot >= 0) ? hostName.Substring(previousDot + 1) : hostName;
}
, , whois. whois #. ; , , , , , , - (, GoDaddy).
, whois ; , ARIN, RIPE. , , , , , ; , X Y.