This documentation is archived and is not being maintained.

ServicePointManager.DnsRefreshTimeout Property

Gets or sets a value that indicates how long a Domain Name Service (DNS) resolution is considered valid.

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

public static int DnsRefreshTimeout { get; set; }
/** @property */
public static int get_DnsRefreshTimeout ()

/** @property */
public static void set_DnsRefreshTimeout (int value)

public static function get DnsRefreshTimeout () : int

public static function set DnsRefreshTimeout (value : int)

Not applicable.

Property Value

The time-out value, in milliseconds. A value of -1 indicates an infinite time-out period. The default value is 120,000 milliseconds (two minutes).

The following code example sets this property.

ServicePointManager.UseNagleAlgorithm = true;
ServicePointManager.Expect100Continue = true;
ServicePointManager.CheckCertificateRevocationList = true;
ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit;
ServicePointManager.EnableDnsRoundRobin = true;
ServicePointManager.DnsRefreshTimeout = 4*60*1000; // 4 minutes

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: