This article was previously published under Q187709
This article has been archived. It is offered "as is" and will no longer be updated.
When a Windows Sockets application uses DNS to resolve a hostname to anIP address by means of the gethostbyname API, the Domain Name Resolver(DNR) on a computer running Windows NT 4.0 caches the response for the TTL(Time to Live) specified in the response on a per-process basis. This meansthat if there is a change in the IP address of the host computer, theclient application continues to try connecting to the old address.It also means that the same IP address will be used each time, until theTTL expires, if the response contains multiple IP addresses.
Winsock2 support was introduced in Windows NT 4.0. Previous versions ofWindows NT supported a MaxHostentCacheSize registry value, which you couldset to zero to disable caching. Support for this parameter was not includedin Winsock2.
To resolve this problem, obtain the latest service pack for Windows NT 4.0 or Windows NT Server 4.0, Terminal Server Edition. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
152734 How to Obtain the Latest Windows NT 4.0 Service Pack
Support for the MaxHostentCacheSize registry value has been added toWinsock2. The registry value controls the number of cache entries thatare available to the process. If you set the value to zero, no cachingwill be done.
NOTE: The above link is one path; it has been wrapped for readability.
Value type: REG_DWORD Default value: 10
Microsoft has confirmed that this is a problem in Windows NT 4.0 and Windows NT Server 4.0, Terminal Server Edition. This problem was first corrected in Windows NT 4.0 Service Pack 4.0 and Windows NT Server 4.0, Terminal Server Edition Service Pack 4.