This documentation is archived and is not being maintained.

ServicePointManager.DnsRefreshTimeout Property

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

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)

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 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, 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
Show: