Sha256: cf7d468dec70ae7eb2813999bb3c12888cd22e743636e2936d2cc25bced39017

Contents?: true

Size: 1.24 KB

Versions: 10

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'resolv'
require 'json'

STDIN.each_line do |line|

  domain = line.chomp

  begin

    Resolv::DNS.open do |dns|
      dns.each_resource(domain, Resolv::DNS::Resource::IN::A) do |r|
        puts ({ :type => 'A', :value => r.address.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

      dns.each_resource(domain, Resolv::DNS::Resource::IN::AAAA) do |r|
        puts ({ :type => 'AAAA', :value => r.address.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

      dns.each_resource(domain, Resolv::DNS::Resource::IN::SOA) do |r|
        puts ({ :type => 'SOA', :value => r.mname.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

      dns.each_resource(domain, Resolv::DNS::Resource::IN::NS) do |r|
        puts ({ :type => 'NS', :value => r.name.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

      dns.each_resource(domain, Resolv::DNS::Resource::IN::MX) do |r|
        puts ({ :type => 'MX', :value => r.exchange.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

      dns.each_resource(domain, Resolv::DNS::Resource::IN::TXT) do |r|
        puts ({ :type => 'TXT', :value => r.data.to_s, :ttl => r.ttl, :domain => domain }).to_json
      end

    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ix-cli-0.0.27 bin/ix-domain-dns
ix-cli-0.0.26 bin/ix-domain-dns
ix-cli-0.0.25 bin/ix-domain-dns
ix-cli-0.0.24 bin/ix-domain-dns
ix-cli-0.0.23 bin/ix-domain-dns
ix-cli-0.0.22 bin/ix-domain-dns
ix-cli-0.0.21 bin/ix-domain-dns
ix-cli-0.0.20 bin/ix-domain-dns
ix-cli-0.0.19 bin/ix-domain-dns
ix-cli-0.0.18 bin/ix-domain-dns