Sha256: 5234dbebfa1e0082fabd114885ed67cb13407993f37bfe5071b4e46a8d8521c1

Contents?: true

Size: 374 Bytes

Versions: 3

Compression:

Stored size: 374 Bytes

Contents

require 'dnsruby'
module BrighterPlanet
  class Metadata
    module AuthoritativeDnsResolver
      def self.getaddress(domain_name)
        r = ::Dnsruby::Resolver.new(:nameserver => %w{ ns1.easydns.com ns2.easydns.com ns3.easydns.org })
        q = r.query domain_name, ::Dnsruby::Types.A, ::Dnsruby::Classes.IN
        q.answer[0].address.to_s
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brighter_planet_metadata-0.0.4 lib/brighter_planet_metadata/authoritative_dns_resolver.rb
brighter_planet_metadata-0.0.3 lib/brighter_planet_metadata/authoritative_dns_resolver.rb
brighter_planet_metadata-0.0.2 lib/brighter_planet_metadata/authoritative_dns_resolver.rb