使用 C 查询自定义 DNS 服务器
我想向我自己的 DNS 服务器而不是默认服务器进行 DNS 查询。
我可以使用哪个 api 来做到这一点?
我知道 getaddrinfo (其中 ping.exe 使用),但是我怎样才能让这个函数查询我的 dns 服务器,而不是默认的呢?
谢谢!
I want to make a DNS query to my own DNS server instead the default one.
Which api can I use to do that ?
I know getaddrinfo (which ping.exe using), but how can i make this function query my dns server, instead the default one ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 adns 解析器库。
另一种选择是使用 c-ares 库,该库适用于 Windows 并允许您使用替代名称服务器。
Take a look at the adns resolver library.
Another option is to use the c-ares library, which works on Windows and allows you to use alternative nameservers.