Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 974 Bytes

README.rdoc

File metadata and controls

31 lines (24 loc) · 974 Bytes

Description

This module allows Ruby programs to interface with the GNU adns library (gnu.org/software/adns/). You must have the GNU adns library version >= 1.2 installed in order to build this module.

Installation

gem install adns-ruby

Example

require 'adns'
require 'pp'

adns= ADNS::State.new   
domain= "rubygems.org"

query_list= Hash.new
query_list[adns.submit(domain, ADNS::RR::MX)]= 'MX'
query_list[adns.submit(domain, ADNS::RR::A)]= 'A'
query_list[adns.submit(domain, ADNS::RR::NS)]= 'NS'
query_list[adns.submit(domain, ADNS::RR::SOA)]= 'SOA'

for (query, rr) in query_list
	puts rr.center(20, "*")
	pp query.wait
end

More Examples

For more examples, you can browse the examples/ directory in the adns-ruby gem installation path or you can visit the github repository (github.com/tuladhar/adns-ruby) and browse the examples/ directory.

Source Code

git clone https://github.com/tuladhar/adns-ruby