Cookbooks
bind
documentation
Bind Config

Back to resource list

bind_config

Creates the configuration files for the name server.

Actions

ActionDescription
:createCreate the default configuration files (including RFC1912 zones), configure an rndc key, and set any query logging parameters required.

Properties

The query_log properties are deprecated and will be removed in a future version. Migrate to using the bind_logging_channel and bind_logging_category resources.

NameTypeDefaultDescription
additional_config_filesArray[]Array of additional config files to include in named.conf
bind_serviceStringdefaultName of the bind_service resource to notify actions on
chroot_dirStringsee default_property_forDefine the chrooted base directory
chroottrue, falsefalseConfiguring a chrooted nameserver
conf_fileStringsee default_property_forThe desired full path to the main configuration file
controlsArray[]Array of control statements
default_viewStringdefaultThe name of the default view to configure zones within when views are used
ipv6_listentrue, falsetrueEnables listening on IPv6 instances
optionsArray[]Array of option strings. Each option should be a valid BIND option minus the trailing semicolon.
options_fileStringsee default_property_forThe desired full path to the configuration file containing options
per_view_additional_config_fileArray[]Array of additional per view config files to include in named.conf
statistics_channelHash, ArraynilPresence turns on the statistics channel. Should be a hash containing :address and :port to configure the location where the statistics channel will listen on. This will likely move to a separate resource in the future.
primariesHash{}List of name servers for which the server is secondary to, in the format name => %w(list of ips). Can be referred to abbreviate primaries or also-notify in zones.

The following properties are deprecated and will be removed in a future release of this cookbook:

NameTypeDefaultDescription
query_log_max_sizeString1mMaximum size of query log before rotation
query_log_optionsArray[]Array of additional query log options
query_logStringnilIf provided will turn on general query logging. Should be the path to the desired log file
query_log_versionsString, Integer2Number of rotated query logs to keep on the system

Examples

bind_config 'default'
 
bind_config 'default' do
  ipv6_listen false
 
  options [
    'recursion no',
    'allow-transfer { external-dns; }'
  ]
end
 
bind_config 'default' do
  statistics_channel address: 127.0.0.1, port: 8090
 
  query_log '/var/log/named/query.log'
  query_log_versions 5
  query_log_max_size '10m'
  query_log_options [
    'print-time yes'
  ]
end