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(); };
public abstract string DnsSuffix { get; }
member this.DnsSuffix : string
Public MustOverride ReadOnly Property DnsSuffix As String

Valeur de propriété

Qui String contient le suffixe DNS pour cette interface, ou Empty s’il n’existe aucun suffixe DNS pour l’interface.

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 ») ajouté à un nom d’hôte non qualifié pour obtenir un nom de domaine complet (FQDN) adapté à une requête de nom DNS. Par exemple, si l’ordinateur local a « contoso.com » comme son DnsSuffix, et doit résoudre le nom d’hôte non qualifié « www », le nom de domaine complet à interroger est «www.contoso.com».

S’applique à