Partager via


IPInterfaceProperties.DnsSuffix Propriété

Définition

Obtient le suffixe DNS (Domain Name System) associé à cette interface.

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

Valeur de propriété

String qui contient le suffixe DNS de cette interface ou Empty s'il n'y a aucun suffixe DNS pour l'interface.

Attributs

Exemples

L’exemple de code suivant affiche le suffixe 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

Remarques

Le suffixe DNS identifie le nom de domaine (par exemple, « contoso.com ») qui est ajouté à un nom d’hôte non qualifié pour obtenir un nom de domaine complet (FQDN) approprié pour une requête de nom DNS. Par exemple, si l’ordinateur local a « contoso.com » comme DnsSuffixet doit résoudre le nom d’hôte non qualifié « www », le nom de domaine complet à interroger est « www.contoso.com ».

S’applique à