Get FQDN in C# running on Mono
问题 I'm using Xamarin.mac. I need to get the fully qualified domain name of the local computer. On Windows this code works: public string GetFQDN() { string domainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName; string hostName = Dns.GetHostName(); string fqdn = ""; if (!hostName.Contains(domainName)) fqdn = hostName + "." + domainName; else fqdn = hostName; return fqdn; } On a mac this code causes this error: System.NotSupportedException: This platform