Sample code for 30+ languages & platforms
VBScript

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 VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

set socket = CreateObject("Chilkat.Socket")

'  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 
outFile.WriteLine("DNS cache cleared.")

outFile.Close