lib/extended_classes.rb
def dig_a
    Resolv::DNS.open do |dns|
      txts = dns.getresources(self,Resolv::DNS::Resource::IN::A).collect { |r| r.address.to_s }
      if txts.empty? then nil else txts[0] end
    end
  end
# returns list of IPV4 addresses, or nil
# (there should only be one IPV4 address)
returns list of IPV4 addresses, or nil
(there should only be one IPV4 address)
returns list of IPV4 addresses or nil ( there should only be one IPV4 address )
def dig_a
    Resolv::DNS.open do |dns|
      txts = dns.getresources(self,Resolv::DNS::Resource::IN::A).collect { |r| r.address.to_s }
      if txts.empty? then nil else txts[0] end
    end
  end
def dig_a Resolv :: DNS . open do | dns | txts = dns . getresources ( self , Resolv :: DNS :: Resource :: IN :: A ) . collect { | r | r . address . to_s } if txts . empty? then nil else txts [ 0 ] end end end
returns list of IPV4 addresses, or nil
(there should only be one IPV4 address)
returns list of IPV4 addresses or nil ( there should only be one IPV4 address )