在C / C DNS查找++ [英] DNS lookup in c/c++

查看:169
本文介绍了在C / C DNS查找++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须写这就像挖和nslookup一点点的C / C ++程序:它必须知道的任何网站的IP地址。它应该做的事情,如挖www.example.com MX +简短的命令一样。我无法想象如何才能做到这一点。任何想法?

I must write a C/C++ program which works a little bit like dig and nslookup: it must know IP addresses of any site. It should do things like the dig www.example.com MX +short command does. I can't imagine how can this be done. Any ideas?

推荐答案

使用任何你喜欢的解析库。热门库包括 UDNS 并的 ADNS 。你也可以只修改源$ C ​​$ C到(这是的绑定分布)。

Use any resolver library you like. Popular libraries include UDNS and adns. You could also just modify the source code to dig (which is part of the bind distribution).

这篇关于在C / C DNS查找++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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