tags:

views:

193

answers:

1

nslookup.exe 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?

+5  A: 

You can use the pExtra parameter to the DNSQuery function.

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.

Alnitak
Exactly what I am looking for. Why Microsoft hide that parameter?
est