using System.Net; namespace Renci.SshNet.Abstractions { internal static class DnsAbstraction { /// /// Returns the Internet Protocol (IP) addresses for the specified host. /// /// The host name or IP address to resolve /// /// An array of type that holds the IP addresses for the host that /// is specified by the parameter. /// public static IPAddress[] GetHostAddresses(string hostNameOrAddress) { #if FEATURE_DNS_ASYNC return Dns.GetHostAddressesAsync(hostNameOrAddress).Result; #else return Dns.GetHostAddresses(hostNameOrAddress); #endif } /// /// Resolves a host name or IP address to an instance. /// /// The host name or IP address to resolve. /// /// An instance that contains address information about the host /// specified in . /// public static IPHostEntry GetHostEntry(string hostNameOrAddress) { #if FEATURE_DNS_ASYNC return Dns.GetHostEntryAsync(hostNameOrAddress).Result; #else return Dns.GetHostEntry(hostNameOrAddress); #endif } } }