java Java中的简单*权威DNS服务器*
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4973648/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Simple *Authoritative DNS Server* in Java
提问by Bryan Field
Is there an already written Java DNS Server that only implements authoritative responses. I would like to take the source code and move it into a DNS server we will be developing that will use custom rule sets to decide what TTL to use and what IP address to publish.
是否有一个已经编写的 Java DNS 服务器,它只实现权威响应。我想获取源代码并将其移动到我们将开发的 DNS 服务器中,该服务器将使用自定义规则集来决定要使用的 TTL 和要发布的 IP 地址。
The server will not be a caching server. It will only return authoritative results and only be published on the WHOIS record for the domains. It will never be called directly.
该服务器将不是缓存服务器。它只会返回权威结果,并且只会在域的 WHOIS 记录上发布。它永远不会被直接调用。
The server will have to publish MX records, A records and SPF/TXT records. The plan is to use DNS to assist in load balancing among gateway-servers on multiple locations (we are aware that DNS has a short reach in this area). Also it will cease to publish IP addesses of gateway-servers when they go down (on purpose or on accident) (granted, DNS will only be able to help during extended outages).
服务器必须发布 MX 记录、A 记录和 SPF/TXT 记录。计划是使用 DNS 来协助多个位置的网关服务器之间的负载平衡(我们知道 DNS 在这方面的范围很短)。此外,当网关服务器出现故障(有意或无意)时,它将停止发布 IP 地址(当然,DNS 只能在长时间停机期间提供帮助)。
We will write the logic for all this ourselves.. but I would very much like to start with a DNS server that has been through a little testing instead of starting from scratch.
我们将自己编写所有这些逻辑......但我非常想从一个经过一些测试的 DNS 服务器开始,而不是从头开始。
However, that is only feasible if what we copy from is simple enough. Otherwise,, it could turn out to be a waste of time
然而,只有当我们复制的内容足够简单时,这才是可行的。否则,它可能会变成浪费时间
采纳答案by rajeshnair
George,
乔治,
I guess what you need is a java library which implements DNS protocol. Take a look at dnsjava
我想你需要的是一个实现 DNS 协议的 java 库。看看dnsjava
This is very good in terms of complete spec coverage of all types of records and class.
就所有类型的记录和类的完整规范覆盖而言,这是非常好的。
But the issue which you mightface with a java based library is performance. DNS servers would be expected to have a high throughput. But yes, you can solve that by throwing more hardware.
但是您在使用基于 Java 的库时可能面临的问题是性能。预计 DNS 服务器将具有高吞吐量。但是,是的,您可以通过投放更多硬件来解决该问题。
If performance isa concern for you , I would suggest to look into unbound
如果性能是你所关心,我会建议寻找到绑定
回答by Robert Tupelo-Schneck
Unfortunately, the documentation states "jnamed should not be used for production, and should probably not be used for testing. If the above documentation is not enough, please do not ask for more, because it really should not be used."
不幸的是,文档指出“jnamed 不应该用于生产,也可能不应该用于测试。如果以上文档还不够,请不要要求更多,因为它真的不应该使用。”
I'm not aware of any better alternatives, however.
但是,我不知道有什么更好的选择。
回答by user1216808
You could take a look at Eagle DNS: http://www.unlogic.se/projects/eagledns
你可以看看 Eagle DNS:http: //www.unlogic.se/projects/eagledns
It's been around for a few years and it's quite well tested by now.
它已经存在了几年,现在已经得到很好的测试。