Version information
This module has been deprecated by its author since Jun 26th 2023.
The author has suggested puppet-dnsquery as its replacement.
Start using this module
Documentation
DNS query functions
This module contains query functions for DNS for use from Puppet.
Usage
All functions can take a optional second lambda argument that is called if the lookup returned no values. Then the result of the lambda will be used instead.
dns_lookup
Does a DNS lookup and returns an array of addresses.
dns_a
Retrieves DNS A records and returns it as an array. Each record in the array will be a IPv4 address.
dns_aaaa
Retrieves DNS AAAA records and returns it as an array. Each record in the array will be a IPv6 address.
dns_cname
Retrieves a DNS CNAME record and returns it as a string.
dns_mx
Retrieves DNS MX records and returns it as an array. Each record in the
array will be an array of hashes containing a preference
& exchange
key.
dns_ptr
Retrieves DNS PTR records and returns it as an array of strings.
dns_srv
Retrieves DNS SRV records and returns it as an array. Each record in the
array will be an array of hashes containing a priority
, weight
, port
and target
key.
dns_txt
Retrieves DNS TXT records and returns it as an array. Each record in the array will be a array containing the strings of the TXT record.
3.0.0:
- Add an optional lambda argument that is called and returned instead if the lookup raises an exception or returns an empty result.
- Change return format on dns_srv and dns_mx to an array of hashes. This removes the need for the optional field parameter. That can be fetched using the map function in Puppet 4.x+ instead.
- Use the Puppet 4 function API.
2.0.1:
- correctly convert array of Resolv::IPv4 or Resolv::IPv6 to array strings
2.0.0:
- Raise an exception on empty replies.
Copyright (C) 2012 by Erik Dalen <erik.gustav.dalen@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.