Reputation: 15922
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?
Upvotes: 2
Views: 2612
Reputation: 3403
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
.
Upvotes: 2
Reputation:
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.
Upvotes: -1
Reputation: 35529
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.)
Upvotes: 3