akshat
akshat

Reputation: 15922

Is there a good DNS server library in ruby?

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

Answers (4)

Dmitry Polushkin
Dmitry Polushkin

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

Alex
Alex

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

Peter_Tonoli
Peter_Tonoli

Reputation: 151

RubyDNS is what you're looking for.

Upvotes: 3

bortzmeyer
bortzmeyer

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

Related Questions