问题描述
我需要在C / C ++中构建一个自定义简单的非权威缓存DNS服务器。任何指导?链接?样品?
谢谢!
I need to build a custom simple non-authoritative caching DNS server in C/C++. Any guidance? Links? Samples?Thanks!
推荐答案
没有像简单的缓存DNS服务器这样的东西,特别是如果你想要体面的安全。最近的DNS攻击已经显示递归DNS服务器中的缓存功能特别脆弱。
There's no such thing as a "simple" cacheing DNS server, particularly if you want decent security. Recent DNS attacks have shown that the cacheing function in recursive DNS servers is particularly vulnerable.
重新评估您是否确实需要本地缓存。如果你不这样做,你可能更好地修改现有的DNS代理代码(如'dnsmasq')。
Re-evaluate whether you actually need local cacheing of your own. If you don't, you're probably better off modifying existing DNS proxy code (such as 'dnsmasq').
如果你想自己滚动有很好的图书馆,例如 ldns
可以提供对底层DNS数据包的访问。
If you do want to roll-your-own, there are good libraries such as ldns
which can provide the access to the underlying DNS packets.
我正在使用 ldns
code> libevent 来实现我之前提到的Fuzzing DNS服务器。
I'm using ldns
myself in conjunction with libevent
to implement the Fuzzing DNS server I mentioned in an earlier question.
这篇关于如何在C / C ++中构建一个简单的DNS服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!