Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.4.x
- Puppet >= 4.9.0
- , , , , , , , , , ,
This module has been deprecated by its author since Dec 16th 2020.
The author has suggested puppet-unbound as its replacement.
Start using this module
Documentation
Puppet powered DNS with Unbound
A puppet module for the Unbound caching resolver.
Supported Platforms
- Debian
- FreeBSD
- OpenBSD
- OS X (macports)
- RHEL clones (with EPEL)
- openSUSE (local repo or obs://server:dns)
Requirements
To use this module, you must be running at least Puppet 4.4. If you are on an older version of Puppet, please use a 1.x version of this module.
To use this module, you must install the puppetlabs/concat
and
puppetlabs/stdlib
modules, either from the forge using puppet module install
, or ensuring the following lines are present in your Puppetfile for an
R10k deployment.
mod 'concat', :git => 'git://github.com/puppetlabs/puppetlabs-concat.git'
mod 'stdlib', :git => 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
Usage
Server Setup
At minimum you should setup the interfaces to listen on and allow access to a few subnets. This will tell unbound which interfaces to listen on, and which networks to allow queries from.
class { "unbound":
interface => ["::0","0.0.0.0"],
access => ["10.0.0.0/20","::1"],
}
Or, using hiera
unbound::interface:
- '::0'
- '0.0.0.0'
unbound::access:
- '10.0.0.0/20'
- '::1'
Stub Zones
These are zones for which you have an authoritative name server and want to direct queries.
unbound::stub { "lan.example.com":
address => '10.0.0.10',
insecure => true,
}
unbound::stub { "0.0.10.in-addr.arpa.":
address => '10.0.0.10',
insecure => true,
}
# port can be specified
unbound::stub { "0.0.10.in-addr.arpa.":
address => '10.0.0.10@10053',
insecure => true,
}
# address can be an array.
# in the following case, generated conf would be as follows:
#
# stub-host: ns1.example.com
# stub-addr: 10.0.0.10@10053
# stub-host: ns2.example.com
#
# note that conf will be generated in the same order provided.
unbound::stub { "10.0.10.in-addr.arpa.":
address => [ 'ns1.example.com', '10.0.0.10@10053', 'ns2.example.com' ],
}
Or, using hiera
unbound::stub:
'10.0.10.in-addr.arpa.':
address:
- 'ns1.example.com'
- '10.0.0.10@10053'
- 'ns2.example.com'
Unless you have DNSSEC for your private zones, they are considered insecure,
noted by insecure => true
.
Static DNS records
For overriding DNS record in zone.
unbound::record { 'test.example.tld':
type => 'A',
content => '10.0.0.1',
ttl => '14400',
}
Or, using hiera
unbound::record:
'test.example.tld':
type: 'A'
content: '10.0.0.1'
ttl: '14400'
Forward Zones
Setup a forward zone with a list of address from which you should resolve queries. You can configure a forward zone with something like the following:
unbound::forward { '.':
address => [
'8.8.8.8',
'8.8.4.4'
]
}
Or, using hiera
unbound::forward:
'.':
address:
- '8.8.8.8'
- '8.8.4.4'
This means that your server will use the Google DNS servers for any zones that it doesn't know how to reach and cache the result.
Domain Insecure
Sets domain name to be insecure, DNSSEC chain of trust is ignored towards the domain name. So a trust anchor above the domain name can not make the domain secure with a DS record, such a DS record is then ignored. Also keys from DLV are ignored for the domain. Can be given multiple times to specify multiple domains that are treated as if unsigned. If you set trust anchors for the domain they override this setting (and the domain is secured).
class {'unbound:'
domain_insecure => ['example.com', example.org']
}
Or, using hiera
unbound::domain_insecure:
- example.com
- example.org
Local Zones
Configure a local zone. The type determines the answer to give if there is no match from local-data. The types are deny, refuse, static, transparent, redirect, nodefault, typetranspar- ent, inform, inform_deny, always_transparent, always_refuse, always_nxdomain. See local-zone in the unbound documentation for more information. You can configure a local-zone with something like the following.
class {'unbound:'
local_zone => { '10.0.10.in-addr.arpa.' => 'nodefault'}
}
Or, using unbound::localzone
unbound::localzone { '10.0.10.in-addr.arpa.':
type => 'nodefault'
}
Or, using hiera
unbound::local_zone:
10.0.10.in-addr.arpa.: nodefault
11.0.10.in-addr.arpa.: nodefault
Fine grain access-control
class { "unbound":
interface => ["::0","0.0.0.0"],
access => ["10.0.0.0/20", "10.0.0.5/32 reject", "::1 allow_snoop"],
}
The access option allows to pass the action for each subnets, if the action is not provided we assume it’s 'allow'.
Adding arbitrary unbound configuration parameters
class { "unbound":
interface => ["::0","0.0.0.0"],
access => ["10.0.0.0/20","::1"],
custom_server_conf => [ 'include: "/etc/unbound/conf.d/*.conf"' ],
}
The custom_server_conf option allows the addition of arbitrary configuration parameters to your server configuration. It expects an array, and each element gets added to the configuration file on a separate line. In the example above, we instruct Unbound to load other configuration files from a subdirectory.
Remote Control
The Unbound remote controls the use of the unbound-control utility to issue commands to the Unbound daemon process.
class { "unbound::remote":
enable => true,
}
On some platforms this is needed to function correctly for things like service reloads.
Skipping hints download
In the case you're only building a caching forwarder and don't do iterative lookups you might not want to download the hints file containing the root nameservers because you don't need it, or you also might not be able to download it anyway because your server is firewalled which would cause the module would hang on trying to download the hints file. To skip the download set the skip_roothints_download parameter to true.
class { "unbound":
skip_roothints_download => true,
}
More information
You can find more information about Unbound and its configuration items at unbound.net.
Contribute
Please help me make this module awesome! Send pull requests and file issues.
Unreleased
2018-12-21 2.4.0
Summary
Improvements and additional support for unbound features.
Notable changes:
- Change default value for interface.
- Change default values for harden_short_bufsize and harden_large_queries.
- Include new options for pythonscript, dns64, client_subnet, ipsecmod_ and redis_* and a few more unbound modules.
- Add support for SmartOS.
- Pidfile fix.
- Slight changes to data types on unbound class.
- Revive localzone define.
2018-06-02 2.3.2
Updates to modulesync_config, and ensure that unbound is restarted when the interface is changed, as a reload is insufficient.
2018-05-31 2.3.1
Summary
Add missing module-config parameter to the template. This was lost as part of 8ab7ee7cdb7ec940c6f2fabd5c3aadca5a1448e4, and here we are bringing it back.
2018-05-31 2.3.0
Summary
Backwards incompatible change for setting unbound service 'hasstatus' to true. This was previously disabled for older Debian, but this has likely been a bad default to have.
2018-05-21 2.2.0
Summary
This release contains a significant modulesync update, and several small default param changes.
Pram changes:
- username is now owner by default
- pidfile is now /var/run/unbound/unbound.pid by default
- do_daemonize param is now true by default
- add msg-cache-size
- constrain unblock-lan-zones to 1.5.0
- constrain udp-upstream-without-downstream to 1.6.7
- add forward-ssl-upstream to forward class
- add forward-host to forward class
2018-02-25 2.1.0
Summary
This release contains updates to testing, configuration template improvements, and additional options from the unbound.conf manpage.
2016-10-28 2.0.0
Summary
This release contains bugfixes, platform support change, and puppet version support changes.
Features
- Use native Puppet4 class input validation
- Use native Puppet4 hiera module data for platform differences
- Ease testing by using rspec-puppet-facts
- Add support for FreeBSD port
Bugfixes
- FreeBSD testing was incomplete due to a bug in the tests
Backwards incompatible changes
- Drop support for puppet 3.x to leverage new puppet 4.x features
- Drop support for local_unbound on FreeBSD
Dependencies
- puppetlabs/concat (>=1.2.1)
- puppetlabs/stdlib (>=5.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2013 Puppet Labs Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.