为什么nslookup.exe可以使用指定的DNS服务器解决,但dnsapi.dll中没有相应的API? [英] Why nslookup.exe can resolved with a specified DNS server, but there isn't corresponding API in dnsapi.dll?

查看:312
本文介绍了为什么nslookup.exe可以使用指定的DNS服务器解决,但dnsapi.dll中没有相应的API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

nslookup.exe www.google.com 127.0.0.1

nslookup.exe www.google.com 127.0.0.1

此命令可以使用DNS服务器127.0.0.1解析,实现全栈DNS协议解析器是不可能的在一个75.0 KB的nslookup.exe中,所以它一定是使用dnsapi.dll。

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.

所以哪个dll导出C函数可以提供类似的gethostbyname()与指定的DNS服务器在dnsapi.dll中?

So which dll export C function can provide similar gethostbyname() with a specified DNS server in dnsapi.dll?

推荐答案

您可以使用 pExtra 参数 DNSQuery 函数。

显然, MSDN文档不完整,因为它表示此参数必须为空。

Apparently the MSDN documentation is incomplete, since it says this parameter must be null.

请参阅 http://support.microsoft.com/kb/831226 其使用的一个例子。

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

这篇关于为什么nslookup.exe可以使用指定的DNS服务器解决,但dnsapi.dll中没有相应的API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆