nslookup.exe http://www.google.com 127.0.0.1
This command can resolve using DNS server 127.0.0.1, it’s impossible to implement a full stack DNS protocol resolver in a 75.0 KB nslookup.exe, so it must have been using dnsapi.dll.
So which dll export C function can provide similar gethostbyname() with a specified DNS server in dnsapi.dll?
You can use the
pExtraparameter to theDNSQueryfunction.Apparently the MSDN documentation is incomplete, since it says this parameter must be null.
See http://support.microsoft.com/kb/831226 for an example of its use.