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?