Forge Home

dns

Manage the ISC BIND daemon

399,852 downloads

315 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 10.3.0 (latest)
  • 10.2.0
  • 10.1.0
  • 10.0.0
  • 9.6.0
  • 9.5.1
  • 9.5.0
  • 9.4.0
  • 9.3.0
  • 9.2.0
  • 9.1.0
  • 9.0.0
  • 8.2.0
  • 8.1.0
  • 8.0.0
  • 7.0.0
  • 6.2.0
  • 6.1.0
  • 6.0.0
  • 5.4.0
  • 5.3.1
  • 5.3.0
  • 5.2.0
  • 5.1.0
  • 5.0.1
  • 5.0.0
  • 4.1.0
  • 4.0.0
  • 3.4.1
  • 3.4.0
  • 3.3.1
  • 3.3.0
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.0.1
  • 2.0.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.2.0-rc3 (pre-release)
  • 1.2.0-rc2 (pre-release)
  • 1.2.0-rc1 (pre-release)
released Feb 19th 2024
This version is compatible with:
  • Puppet Enterprise 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
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , , Archlinux,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'theforeman-dns', '10.3.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add theforeman-dns
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install theforeman-dns --version 10.3.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: bind, dns, foreman, named, isc

Documentation

theforeman/dns — version 10.3.0 Feb 19th 2024

Reference

Table of Contents

Classes

Public Classes

  • dns: Manage an ISC BIND nameserver

Private Classes

  • dns::config: Configure dns
  • dns::install: Install dns service
  • dns::logging: Enable logging for named
  • dns::params: Default parameters
  • dns::service: Enable and start dns service

Defined types

Functions

Data types

Classes

dns

Manage an ISC BIND nameserver

  • See also
    • dns::zone
    • dns::key
    • dns::logging::category
    • dns::logging::channel

Parameters

The following parameters are available in the dns class:

namedconf_path

Data type: Stdlib::Absolutepath

Path of the named config

Default value: $dns::params::namedconf_path

dnsdir

Data type: Stdlib::Absolutepath

Directory holding the named configs

Default value: $dns::params::dnsdir

dns_server_package

Data type: String

Name of the package to install

Default value: $dns::params::dns_server_package

rndckeypath

Data type: Stdlib::Absolutepath

Path of the RNDC key

Default value: $dns::params::rndckeypath

optionspath

Data type: Stdlib::Absolutepath

Path of the named options

Default value: $dns::params::optionspath

publicviewpath

Data type: Stdlib::Absolutepath

Path of the config file holding all the zones

Default value: $dns::params::publicviewpath

vardir

Data type: Stdlib::Absolutepath

Directory holding the variable or working files

Default value: $dns::params::vardir

logdir

Data type: Stdlib::Absolutepath

Directory holding the log files for named

Default value: '/var/log/named'

group_manage

Data type: Boolean

Should this module manage the Unix system group under which BIND runs (see dns::params)? Defaults to true. Set to false if you want to manage the system group yourself.

Default value: true

manage_service

Data type: Boolean

Should this module manage the dns service? This only applies to the service management (running, stopped) and not to whether the service should be installed or not. IMPORTANT: this will not reload the service after a config change, you'll have to do that manually or via a separate call to notify

Default value: true

namedservicename

Data type: String

Name of the service

Default value: $dns::params::namedservicename

zonefilepath

Data type: Stdlib::Absolutepath

Directory containing zone files

Default value: $dns::params::zonefilepath

localzonepath

Data type: Variant[Enum['unmanaged'], Stdlib::Absolutepath]

File holding local zones like RFC1912 or RFC1918 files. The special value 'unmanaged' can be used if one plans to create custom RFC1912/RFC1918 zones via dns, where the inclusion of package-shipped zone files is not desired.

Default value: $dns::params::localzonepath

defaultzonepath

Data type: Variant[Enum['unmanaged'], Stdlib::Absolutepath]

File holding some RFC1912 zone includes on systems like Debian. The special value 'unmanaged' can be used if one plans to create custom zones via dns, where the inclusion of package-shipped zone files is not desired.

Default value: $dns::params::defaultzonepath

forward

Data type: Optional[Enum['only', 'first']]

The forward option

Default value: undef

forwarders

Data type: Array[String]

The forwarders option

Default value: []

listen_on_v6

Data type: Variant[String, Boolean]

The listen-on-v6 option

Default value: 'any'

recursion

Data type: Enum['yes', 'no']

The recursion option

Default value: 'yes'

allow_recursion

Data type: Array[String]

The allow-recursion option

Default value: ['localnets', 'localhost']

allow_query

Data type: Array[String]

The allow-query option

Default value: ['any']

empty_zones_enable

Data type: Enum['yes', 'no']

The empty-zones-enable option

Default value: 'yes'

dns_notify

Data type: Optional[Enum['yes', 'no', 'explicit']]

The notify option in named.conf

Default value: undef

dnssec_enable

Data type: Optional[Enum['yes', 'no']]

The dnssec-enable option. This option is deprecated and has no effect since BIND 9.15. It's been removed in BIND 9.18.

Default value: $dns::params::dnssec_enable

dnssec_validation

Data type: Enum['yes', 'no', 'auto']

The dnssec-validation option

Default value: 'yes'

namedconf_template

Data type: String

The template to be used for named.conf

Default value: 'dns/named.conf.erb'

acls

Data type: Hash[String, Array[String]]

Specify a hash of ACLs. Each key is the name of a network, and its value is an array of subnet strings.

Default value: {}

optionsconf_template

Data type: String

The template to be used for options.conf

Default value: 'dns/options.conf.erb'

sysconfig_file

Data type: Optional[Stdlib::Absolutepath]

Path to the sysconfig or default file used to set startup options for named. Under Debian this is /etc/default/bind9, under RedHat this is /etc/sysconfig/named. FreeBSD/DragonFly and ArchLinux do not feature such files, thus the sysconfig parameters are not relevant for these operating systems.

Default value: $dns::params::sysconfig_file

sysconfig_template

Data type: Optional[String]

The template used to model /etc/default/bind9 or /etc/sysconfig/named. Default is "dns/sysconfig.${facts[osfamily]}.erb" for Debian and RedHat, and undef for others.

Default value: $dns::params::sysconfig_template

sysconfig_startup_options

Data type: Optional[String]

Startup options for the named process, rendered as the OPTIONS string in the sysconfig file (see above). Use this to set commandline flags and options for named. For example, to use IPv4 only and disable IPv6 support in named on Debian set this parameter to -u bind -4. The default value depends on the underlying OS.

Default value: $dns::params::sysconfig_startup_options

sysconfig_resolvconf_integration

Data type: Optional[Boolean]

Should named integrate with resolvconf upon startup? Default is false, and this only pertains to the Debian OS family.

Default value: $dns::params::sysconfig_resolvconf_integration

sysconfig_disable_zone_checking

Data type: Optional[Boolean]

Should zone checking be disabled upon named startup? Default is undef, and this only pertains to the RedHat OS family.

Default value: $dns::params::sysconfig_disable_zone_checking

sysconfig_additional_settings

Data type: Hash[String[1], String]

Additional settings to add to the sysconfig file. This is a simple hash of key-value strings that will be rendered as KEY="value" in the sysconfig file. Use this to add custom (environment) variables relevant for named. Default is empty.

Default value: {}

controls

Data type: Hash[String, Hash[String, Data]]

Specify a hash of controls. Each key is the name of a network, and its value is a hash containing 'port' => integer, 'keys' => array and 'allowed_addresses' => array

Default value: $dns::params::controls

statistics_channels

Data type: Hash[String, Hash[String, Data]]

Specify a hash of statistics-channels. Each key is the name of a network, and its value is a hash containing 'port' => integer and 'allowed_addresses' => array

Default value: {}

service_ensure

Data type: Variant[Enum['running', 'stopped'], Boolean]

The ensure attribute on the service

Default value: 'running'

service_enable

Data type: Boolean

Whether to enable the service (start at boot)

Default value: true

service_restart_command

Data type: Optional[String[1]]

Custom command to use when the service will be restarted (notified by configuration changes). Will be passed directly to the restart parameter of the contained service resource. This is useful when you want BIND to reload its configuration instead of restarting the whole process, for example by setting service_restart_command to /usr/sbin/service bind9 reload or /usr/sbin/rndc reload or even /usr/bin/systemctl try-reload-or-restart bind9. Default is 'undef' so the service resource default is used.

Default value: undef

config_check

Data type: Boolean

Should this module run configuration checks before putting new configurations in place? Defaults to true. Set to false if you don't want configuration checks when config files are changed.

Default value: true

additional_options

Data type: Hash[String, Data]

Additional options

Default value: {}

additional_directives

Data type: Array[String]

Additional directives. These are free form strings that allow for full customization. Use with caution.

Default value: []

enable_views

Data type: Boolean

Flag to indicate bind views support. Will remove global zone configuration like localzonepath inclusion.

Default value: false

zones

Data type: Hash[String, Hash]

A hash of zones to be created. See dns::zone for options.

Default value: {}

keys

Data type: Hash[String, Hash]

A hash of keys to be created. See dns::key for options.

Default value: {}

logging_categories

Data type: Hash[String, Hash]

A hash of logging categories to be created. See dns::logging::category for options.

Default value: {}

logging_channels

Data type: Hash[String, Hash]

A hash of logging channels to be created. See dns::logging::channel for options.

Default value: {}

Defined types

dns::dnssec_policy

Manage custom DNSSEC policies

Parameters

The following parameters are available in the dns::dnssec_policy defined type:

dnskey_ttl

Data type: Optional[Integer]

This indicates the TTL to use when generating DNSKEY resource records.

Default value: undef

keys

Data type: Array[Dns::Dnssec_policy_key]

This is a list specifying the algorithms and roles to use when generating keys and signing the zone. Entries in this list do not represent specific DNSSEC keys, which may be changed on a regular basis, but the roles that keys play in the signing policy.

Default value: []

max_zone_ttl

Data type: Optional[Integer]

This specifies the maximum permissible TTL value in seconds for the zone.

Default value: undef

parent_ds_ttl

Data type: Optional[Integer]

This is the TTL of the DS RRset that the parent zone uses.

Default value: undef

parent_propagation_delay

Data type: Optional[String[1]]

This is the expected propagation delay from the time when the parent zone is updated to the time when the new version is served by all of the parent zone’s name servers.

Default value: undef

publish_safety

Data type: Optional[String[1]]

This is a margin that is added to the pre-publication interval in rollover timing calculations, to give some extra time to cover unforeseen events. This increases the time between when keys are published and they become active.

Default value: undef

retire_safety

Data type: Optional[String[1]]

This is a margin that is added to the post-publication interval in rollover timing calculations, to give some extra time to cover unforeseen events. This increases the time a key remains published after it is no longer active.

Default value: undef

signatures_refresh

Data type: Optional[String[1]]

This determines how frequently an RRSIG record needs to be refreshed. The signature is renewed when the time until the expiration time is closer than the specified interval.

Default value: undef

signatures_validity

Data type: Optional[String[1]]

This indicates the validity period of an RRSIG record (subject to inception offset and jitter).

Default value: undef

signatures_validity_dnskey

Data type: Optional[String[1]]

This is similar to signatures-validity, but for DNSKEY records.

Default value: undef

zone_propagation_delay

Data type: Optional[String[1]]

This is the expected propagation delay from the time when a zone is first updated to the time when the new version of the zone is served by all secondary servers.

Default value: undef

dns::key

Generate a new key for the dns

Parameters

The following parameters are available in the dns::key defined type:

algorithm

Data type: String

The algorithm used to generate the secret key

Default value: 'hmac-md5'

filename

Data type: String

The filename to store the key. This is placed in the key directory.

Default value: "${name}.key"

secret

Data type: Optional[String]

This is the secret to be place inside the keyfile, if left empty the key will be generated

Default value: undef

keydir

Data type: Stdlib::Absolutepath

The directory to store the key in. Inherited from the main dns class by default.

Default value: $dns::dnsdir

keysize

Data type: Integer

The size of the key to generate. Only used when generating the key. It's ignored if when a key is specified.

Default value: 512

dns::logging::category

Define new category for logging

Parameters

The following parameters are available in the dns::logging::category defined type:

channels

Data type: Array

The array of channels to attach to the category

order

Data type: Integer[51, 59]

The order of the category in the configuration file

Default value: 55

dns::logging::channel

Define new channel for logging

Parameters

The following parameters are available in the dns::logging::channel defined type:

file_path

Data type: Optional[Stdlib::Absolutepath]

The path to the log file

Default value: undef

file_size

Data type: Optional[String]

The maximum size the log file is allowed to reach

Default value: undef

file_versions

Data type: Optional[Integer]

The number of log files to keep when rotating

Default value: undef

log_type

Data type: Enum['file', 'null', 'stderr', 'syslog']

The destination type for the log (file, stderr, syslog, or "null")

Default value: undef

order

Data type: Integer[51, 59]

The order of the channel in the configuration file

Default value: 51

print_category

Data type: Optional[Enum['no', 'yes']]

Decide whether to log the category in the log message

Default value: undef

print_severity

Data type: Optional[Enum['no', 'yes']]

Decide whether to log the severity in the log message

Default value: undef

print_time

Data type: Optional[Enum['no', 'yes']]

Decide whether to log the time in the log message

Default value: undef

severity

Data type: Optional[String]

The severity of messages to log

Default value: undef

syslog_facility

Data type: Optional[String]

The syslog facility to use when logging to a syslog log_type

Default value: undef

dns::view

Define new view for the dns

Parameters

The following parameters are available in the dns::view defined type:

match_clients

Data type: Array[String]

The value for match-clients in the view definition

Default value: []

match_destinations

Data type: Array[String]

The value for match-destinations in the view definition

Default value: []

match_recursive_only

Data type: Optional[Enum['yes','no']]

The value for match-recursive-only in the view definition

Default value: undef

allow_transfer

Data type: Array[String]

The value for allow-transfer in the view definition

Default value: []

allow_recursion

Data type: Array[String]

The value for allow-recursion in the view definition

Default value: []

allow_query

Data type: Array[String]

The value for allow-query in the view definition

Default value: []

allow_query_cache

Data type: Array[String]

The value for allow-query-cache in the view definition

Default value: []

also_notify

Data type: Array[String]

The value for also-notify in the view definition

Default value: []

forwarders

Data type: Array[String]

The value for forwarders in the view definition

Default value: []

forward

Data type: Optional[Enum['only','first']]

The value for forward in the view definition. Only used if forwarders is not empty.

Default value: undef

recursion

Data type: Optional[Enum['yes','no']]

The value for recursion in the view definition

Default value: undef

dnssec_enable

Data type: Optional[Enum['yes','no']]

The value for dnssec-enable in the view definition

Default value: undef

dnssec_validation

Data type: Optional[Enum['yes','no']]

The value for dnssec-validation in the view definition

Default value: undef

dns_notify

Data type: Optional[Enum['yes','no','explicit']]

The value for notify in the view definition

Default value: undef

include_localzones

Data type: Boolean

Whether to include the local zones or not. Requires dns::localzonepath not to be unmanaged to be effective.

Default value: true

include_defaultzones

Data type: Boolean

Whether to include the default zones or not. Requires dns::defaultzonepath not to be unmanaged to be effective.

Default value: true

order

Data type: String

The order parameter to the concat fragment.

Default value: '-'

dns::zone

Define new zone for the dns

Parameters

The following parameters are available in the dns::zone defined type:

soaip

Data type: Optional[Stdlib::IP::Address::V4]

The IP address for the SOA. If reverse is false, an A record will be created pointing to this IP address for $soa. This only makes sense if $soa is withing this zone and needs glue records.

Default value: undef

soaipv6

Data type: Optional[Stdlib::IP::Address::V6]

The IPv6 address for the SOA. If reverse is false, an AAAA record will be created pointing to this IP address for $soa. This only makes sense if $soa is withing this zone and needs glue records.

Default value: undef

manage_file

Data type: Boolean

Whether the manage the file resource. When true $manage_file_name is implied.

Default value: true

manage_file_name

Data type: Boolean

Whether to set the file parameter in the zone file.

Default value: false

replace_file

Data type: Boolean

Whether to update the zone file when a change is detected.

Default value: false

update_policy

Data type: Optional[Dns::UpdatePolicy]

This can be used to specifiy additional update policy rules in the following format { '<KEY_NAME' => {'matchtype' => '', 'tname' => '', 'rr' => 'VALUE' } } Example {'foreman_key' => {'matchtype' => 'zonesub', 'rr' => 'ANY'}} tname and rr are optional

Default value: undef

target_views

Data type: Array[String]

Default value: []

zonetype

Data type: String

Default value: 'master'

soa

Data type: String

Default value: $facts['networking']['fqdn']

reverse

Data type: Boolean

Default value: false

ttl

Data type: String

Default value: '10800'

refresh

Data type: Integer

Default value: 86400

update_retry

Data type: Integer

Default value: 3600

expire

Data type: Integer

Default value: 604800

negttl

Data type: Integer

Default value: 3600

serial

Data type: Integer

Default value: 1

records

Data type: Array[String[1]]

A list of records which will be added to the zone file in the RFC 1035 format (see https://datatracker.ietf.org/doc/html/rfc1035) Example ['host1 IN A 192.168.0.10', 'alt-host1 IN CNAME host1']

Default value: []

masters

Data type: Array

Default value: []

allow_transfer

Data type: Array

Default value: []

allow_query

Data type: Array

Default value: []

allow_update

Data type: Array

Default value: []

also_notify

Data type: Array

Default value: []

zone

Data type: String

Default value: $title

contact

Data type: Optional[String]

Default value: undef

zonefilepath

Data type: Stdlib::Absolutepath

Default value: $dns::zonefilepath

filename

Data type: String

Default value: "db.${title}"

forward

Data type: Enum['first', 'only']

Default value: 'first'

master_empty_forwarders_enable

Data type: Boolean

Enable empty forwarders option in master zone. Applicable when forwarders are empty and zonetype is set to master.

Default value: false

forwarders

Data type: Array

Default value: []

dns_notify

Data type: Optional[Enum['yes', 'no', 'explicit']]

Default value: undef

zone_statistics

Data type: Optional[Enum['yes', 'no']]

Default value: undef

key_directory

Data type: Optional[Stdlib::Absolutepath]

Default value: undef

inline_signing

Data type: Optional[Enum['yes', 'no']]

Default value: undef

dnssec_secure_to_insecure

Data type: Optional[Enum['yes', 'no']]

Default value: undef

auto_dnssec

Data type: Optional[Enum['allow', 'maintain', 'off']]

Default value: undef

dnssec_policy

Data type: Optional[String[1]]

Causes the zone to be signed and turns on automatic maintenance for the zone.

Default value: undef

Functions

date

Type: Ruby 3.x API

The date function.

date()

The date function.

Returns: Any

dns::reverse_dns

Type: Ruby 4.x API

Get the reverse DNS for an IP address

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

The dns::reverse_dns function.

Returns: Stdlib::Fqdn

ip

Data type: Stdlib::IP::Address::Nosubnet

The IP address to get the reverse for

get_in_addr_arpa

Type: Ruby 4.x API

DEPRECATED. Use the dns::reverse_dns function instead.

get_in_addr_arpa(Any *$args)

The get_in_addr_arpa function.

Returns: Any

*args

Data type: Any

Data types

Dns::Dnssec_policy_key

Validate dnssec-policy parameter

Alias of

Struct[{
    type      => Enum['csk', 'ksk', 'zsk'],
    directory => Optional[Enum['key-directory']],
    lifetime  => String[1],
    algorithm => Variant[String[1], Integer],
    size      => Optional[Integer],
  }]

Dns::UpdatePolicy

Validate update-policy parameter

Alias of

Variant[Enum['local'], Hash[
    String,
    Struct[{
      Optional[action] => Enum['deny', 'grant'],
      Optional[tname]  => String,
      rr               => String,
      matchtype        => Enum[
        '6to4-self',
        'external',
        'krb5-self',
        'krb5-selfsub',
        'krb5-subdomain',
        'ms-self',
        'ms-selfsub',
        'ms-subdomain',
        'name',
        'self',
        'selfsub',
        'selfwild',
        'subdomain',
        'tcp-self',
        'wildcard',
        'zonesub',
      ],
    }],
  ]]