Puppet Function: dns::reverse_dns

Defined in:
lib/puppet/functions/dns/reverse_dns.rb
Function type:
Ruby 4.x API

Summary

Get the reverse DNS for an IP address

Overview

dns::reverse_dns(Stdlib::IP::Address::Nosubnet $ip)Stdlib::Fqdn

Parameters:

  • ip (Stdlib::IP::Address::Nosubnet)

    The IP address to get the reverse for

Returns:

  • (Stdlib::Fqdn)


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/puppet/functions/dns/reverse_dns.rb', line 4

Puppet::Functions.create_function(:'dns::reverse_dns') do
  # @param ip
  #   The IP address to get the reverse for
  dispatch :reverse do
    param 'Stdlib::IP::Address::Nosubnet', :ip
    return_type 'Stdlib::Fqdn'
  end

  def reverse(ip)
    IPAddr.new(ip).reverse
  end
end