Why can nslookup.exe be resolved with the specified DNS server, but there is no corresponding API in dnsapi.dll?

nslookup.exe www.google.com 127.0.0.1

This command can allow the use of the 127.0.0.1 DNS server, it is not possible to implement the full-size DNS protocol of 75.0 KB nslookup.exe, so it should have used dnsapi.dll.

So, what dll c export function can provide similar gethostbyname () with the specified DNS server in dnsapi.dll?

+4
source share
1 answer

You can use the pExtra parameter for the DNSQuery function.

Apparently, the MSDN documentation is incomplete, as it says that this parameter should be null.

See http://support.microsoft.com/kb/831226 for an example of its use.

+6
source

All Articles