This topic has not yet been rated - Rate this topic

IPAddressInformation.IsDnsEligible Property

Note: This property is new in the .NET Framework version 2.0.

Gets a Boolean value that indicates whether the Internet Protocol (IP) address is valid to appear in a Domain Name System (DNS) server database.

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

public abstract bool IsDnsEligible { get; }
/** @property */
public abstract boolean get_IsDnsEligible ()

public abstract function get IsDnsEligible () : boolean

Property Value

true if the address can appear in a DNS database; otherwise, false.

Addresses in the range 169.254.0.0 to 169.254.255.255 are not DNS eligible. These addresses are reserved for Automatic Private IP Addressing (APIPA).

The following code example displays the anycast addresses for the network interfaces on the local computer.

public static void DisplayAnycastAddresses()
{
    Console.WriteLine("Anycast Addresses");
    NetworkInterface[] adapters  = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        IPAddressInformationCollection anyCast = adapterProperties.AnycastAddresses;
        if (anyCast.Count >0)
        {
            Console.WriteLine(adapter.Description);
            foreach (IPAddressInformation any in anyCast)
            {
                Console.WriteLine("  Anycast Address .......................... : {0} {1} {2}", 
                    any.Address,
                    any.IsTransient ? "Transient" : "", 
                    any.IsDnsEligible ? "DNS Eligible" : ""
                );
            }
            Console.WriteLine();
        }
    }
}

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.