The Windows Hosts file allows you to associate an IP to a host name that has far greater freedom than a normal Internet domain name. I\'d like to create a function that dete
How about the System.Uri.CheckHostName() method?
private static bool IsValidDomainName(string name) { return Uri.CheckHostName(name) != UriHostNameType.Unknown; }
Why do the work yourself?