Sample code for 30+ languages & platforms
Unicode C

Clear the DNS Cache

See more Socket/SSL/TLS Examples

Demonstrates Socket.DnsCacheClear, which clears Chilkat's process-wide in-memory DNS cache so subsequent hostname resolutions perform a new lookup.

Background. The cache is shared by Chilkat objects in the process, so clearing it affects subsequent lookups across the application.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkSocketW.h>

void ChilkatSample(void)
    {
    HCkSocketW socket;

    socket = CkSocketW_Create();

    //  Clear Chilkat's process-wide in-memory DNS cache.  Subsequent hostname resolutions perform a new
    //  lookup as needed.  The cache is shared by Chilkat objects in the process.
    CkSocketW_DnsCacheClear(socket);
    wprintf(L"DNS cache cleared.\n");


    CkSocketW_Dispose(socket);

    }