Link to home
Start Free TrialLog in
Avatar of 3axap
3axap

asked on

flushdns

I need to clear the DNS cache and I don't want to use "ipconfig /flushdns".
It looks like dnsapi.dll can be used for that but I can't find any Delphi code example.
Below is a C language example.
I'd like to have the same function for Delphi 7.
Thanks.

BOOL DnsFlushResolverCache()
{
   BOOL (WINAPI *DoDnsFlushResolverCache)();
   *(FARPROC *)&DoDnsFlushResolverCache = GetProcAddress(LoadLibrary("dnsapi.dll"), "DnsFlushResolverCache");
   if(!DoDnsFlushResolverCache) return FALSE;
   return DoDnsFlushResolverCache();
}

Open in new window

SOLUTION
Avatar of DerZauberer
DerZauberer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial