Is there a good DNS server library in ruby?

ぃ、小莉子 提交于 2019-12-23 03:13:28

问题


I want to create a test DNS server in ruby, but could not find anything suitable. I found pnet-dns(http://rubyforge.org/projects/pnet-dns/). This project is incomplete and buggy. Is there any alternative?


回答1:


A language-agnostic alternative is to use PowerDNS pipe backend. Because it communicates with a name server across a simple pipe, it can be written in any language, including Ruby. (The simple example in the documentation uses Perl but it should be easy to translate.)




回答2:


RubyDNS is what you're looking for.




回答3:


Checkout an another approach of DNS server in ruby using celluloid: https://github.com/celluloid/celluloid-dns

The original celluloid-dns is horribly incomplete (v0.0.1). Recently, RubyDNS is being copied into celluloid-dns (I'm doing this as we speak). RubyDNS will be modified to work with the updated celluloid-dns since all core functions will be moved from RubyDNS to celluloid-dns.

If you want something that works right now, use RubyDNS. However, in the future, if you just want the low level APIs, use celluloid-dns.




回答4:


Have you looked at Dnsruby?

It aims to be fully RFC compliant, although it focuses primarily on the client side. It is, however, possible to write your own server - use Dnsruby::Message#decode to decode incoming packets, and a zone of RRSets holding your test records. You can then encode your packets to send back to the client.



来源:https://stackoverflow.com/questions/852123/is-there-a-good-dns-server-library-in-ruby

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!