IPInterfaceProperties.DnsSuffix Property

Gets the Domain Name System (DNS) suffix associated with this interface.

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

public abstract string DnsSuffix { get; }

Property Value

Type: System.String
A String that contains the DNS suffix for this interface, or String.Empty if there is no DNS suffix for the interface.

ExceptionCondition
PlatformNotSupportedException

This property is not valid on computers running operating systems earlier than Windows 2000.

The DNS suffix identifies the domain name (for example, "contoso.com") that is appended to an unqualified host name to obtain a fully qualified domain name (FQDN) suitable for a DNS name query. For example, if the local machine has "contoso.com" as its DnsSuffix, and must resolve the unqualified host name "www", the FQDN to query is "www.contoso.com".

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows Millennium Edition, Windows NT 4.0 Platform Note: This property is not valid on operating systems earlier than Windows 2000.

The following code example displays the DNS suffix.

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

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft