IPInterfaceProperties.IsDnsEnabled Property

 

Gets a Boolean value that indicates whether NetBt is configured to use DNS name resolution on this interface.

Namespace:   System.Net.NetworkInformation
Assembly:  System (in System.dll)

public abstract bool IsDnsEnabled { get; }

Property Value

Type: System.Boolean

true if NetBt is configured to use DNS name resolution on this interface; otherwise, false.

DNS is a hierarchical naming system used to map host names to IP addresses.

The following code example displays the value of this property.

public static void DisplayDnsConfiguration()
{
    NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        Console.WriteLine(adapter.Description);
        Console.WriteLine("  DNS suffix .............................. : {0}",
            properties.DnsSuffix);
        Console.WriteLine("  DNS enabled ............................. : {0}", 
            properties.IsDnsEnabled);
        Console.WriteLine("  Dynamically configured DNS .............. : {0}", 
            properties.IsDynamicDnsEnabled);
    }
    Console.WriteLine();
}

.NET Framework
Available since 2.0
Return to top
Show: