Поделиться через


IPInterfaceProperties.DnsSuffix Свойство

Определение

Возвращает DNS-суффикс, соответствующий данному интерфейсу.

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

Значение свойства

Строка String, которая содержит DNS-суффикс данного интерфейса или значение Empty, если у интерфейса нет DNS-суффикса.

Атрибуты

Примеры

В следующем примере кода отображается DNS-суффикс.

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

Комментарии

DNS-суффикс определяет доменное имя (например, "contoso.com"), которое добавляется к неполному имени узла для получения полного доменного имени (FQDN), подходящего для запроса DNS-имени. Например, если локальный компьютер имеет значение "contoso.com" в качестве DnsSuffixи должен разрешать неполное имя узла "www", полное доменное имя для запроса будет "www.contoso.com".

Применяется к