# dns_lookup.rb
# does a DNS lookup and returns an array of strings of the results

module Puppet::Parser::Functions
  newfunction(:dns_lookup, :type => :rvalue, :doc => <<-EOS
    Does a DNS lookup and returns an array of addresses.
    EOS
  ) do |arguments|
    require 'resolv'

    Resolv::DNS.new.getaddresses(arguments[0]).collect do |res|
      res.address.to_s
    end
  end
end

# dns_lookup.rb
# does a DNS lookup and returns an array of strings of the results

module Puppet::Parser::Functions
  newfunction(:dns_lookup, :type => :rvalue, :doc => <<-EOS
    Does a DNS lookup and returns an array of addresses.
    EOS
  ) do |arguments|
    require 'resolv'

    Resolv::DNS.new.getaddresses(arguments[0]).collect do |res|
      res.to_s
    end
  end
end

Fix conversion of IP address, don't use raw address
Fix conversion of IP address, don't use raw address
