Sample code for 30+ languages & platforms
JavaScript

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.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var socket = new CkSocket();

//  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.
socket.DnsCacheClear();
console.log("DNS cache cleared.");