IPInterfaceProperties::DnsSuffix Property

 

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

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

public:
property String^ DnsSuffix {
	virtual String^ get() abstract;
}

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.

Exception Condition
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".

Win9xFamilyWinMeWinNt4Family

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

The following code example displays the DNS suffix.

void DisplayDnsConfiguration()
{
   array<NetworkInterface^>^adapters = NetworkInterface::GetAllNetworkInterfaces();
   System::Collections::IEnumerator^ myEnum10 = adapters->GetEnumerator();
   while ( myEnum10->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum10->Current);
      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 );
   }
}

.NET Framework
Available since 2.0
Return to top
Show: