DnsFlushResolverCache clears windows DNS Cache and redis cache flush
The effect is equivalent to the ipconfig/flushdns command.
The DnsFlushResolverCache function is exported in Dnsapi. dll without any parameters. He cannot be found in MSDN. It seems to be an unmarshented function. The function prototype is as follows:
Bool winapi DnsFlushResolverCache (VOID );
BOOL __stdcall DnsFlushResolverCache() { BOOL bRet = FALSE; typedef BOOL (WINAPI *PfuncDnsFlushResolverCache)(VOID); HMODULE hDnsModule = LoadLibrary( _T("dnsapi.dll") ); if ( hDnsModule != NULL ) { PfuncDnsFlushResolverCache pFlushFun = GetProcAddress( hDnsModule, "DnsFlushResolverCache" ); if ( pFlushFun != NULL ) { pFlushFun(); bRet = TRUE; } FreeLibrary( hDnsModule ); } return bRet; }
Vb6 statement:
Private Declare Function DnsFlushResolverCache Lib "dnsapi.dll" () As Long