Share via


IPInterfaceProperties.DnsSuffix Vlastnost

Definice

Získá příponu DNS (Domain Name System) přidruženou k tomuto rozhraní.

public:
 abstract property System::String ^ DnsSuffix { System::String ^ get(); };
public abstract string DnsSuffix { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract string DnsSuffix { get; }
member this.DnsSuffix : string
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.DnsSuffix : string
Public MustOverride ReadOnly Property DnsSuffix As String

Hodnota vlastnosti

A String , který obsahuje příponu DNS pro toto rozhraní, nebo Empty pokud neexistuje přípona DNS pro rozhraní.

Atributy

Příklady

Následující příklad kódu zobrazí příponu DNS.

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 );
   }
}
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();
}
Public Shared Sub DisplayDnsConfiguration() 
    Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim adapter As NetworkInterface
    For Each adapter In  adapters
        Dim properties As IPInterfaceProperties = 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)
    Next adapter

End Sub

Poznámky

Přípona DNS identifikuje název domény (například "contoso.com"), který se připojí k nekvalifikovanému názvu hostitele za účelem získání plně kvalifikovaného názvu domény (FQDN) vhodného pro dotaz na název DNS. Pokud má například místní počítač jako DnsSuffix"contoso.com" a musí přeložit nekvalifikovaný název hostitele "www", plně kvalifikovaný název domény pro dotaz je "www.contoso.com".

Platí pro