Skip to content

Latest commit

 

History

History
165 lines (103 loc) · 4.35 KB

REFERENCE.md

File metadata and controls

165 lines (103 loc) · 4.35 KB

Reference

Table of Contents

Classes

  • resolv_conf: Manage the DNS resolver configuration file /etc/resolv.conf

Classes

resolv_conf

Manage the DNS resolver configuration file /etc/resolv.conf

Examples

Create resolver config file using default parameters
class { resolv_conf': }
Create resolver config file with specific name servers
class { resolv_conf':
  nameservers => [ '8.8.8.8', '8.8.4.4', ],
}
Create resolver config file with specific name servers & options
class { resolv_conf':
  nameservers => [ '8.8.8.8', '8.8.4.4', ],
  options     => [ 'rotate', 'timeout:2, ],
}
Create resolver config file where a local name server is prefered
class { resolv_conf':
  nameservers              => [ '8.8.8.8', '8.8.4.4', ],
  prepend_local_nameserver => true,
}

Parameters

The following parameters are available in the resolv_conf class:

nameservers

Data type: Array[String,0,3]

An array of name servers that the resolver should query for hostname lookups. A maximum number of three name servers can be specified. The default value is a single element array containing 127.0.0.1.

domainname

Data type: Optional[String]

A string that is used as a single element searchlist. The parameter is obsolete and will be removed.

Default value: undef

searchlist

Data type: Array[String]

An array of domains that the resolver will search. This parameter cannot be used together with domainname. The old restriction of six entries has been removed. Check your documentation if your operating system release supports more than six items.

Default value: []

sortlist

Data type: Array[String,0,10]

An array of up to 10 IP/netmask items. These are used by the resolver to sort the result in case multiple addresses are returned.

Default value: []

options

Data type: Array[String]

An array of option settings for the resolver. Each array element must be the option to include in the configuration. The following options are recognized: ndots:n, timeout:n, attempts:n, debug, edns0, inet6, ip6-bytestring, ip6-dotint, no-ip6-dotint, no-check-names, rotate, single-request, single-request-reopen. The first three options are expected to use a numeric value for n after the colon. Check the man page resolv.conf(5) for details.

Default value: []

prepend_local_nameserver

Data type: Boolean

A boolean value that determines if a local DNS server should be used first. Setting this parameter to true will add 127.0.0.1 before the servers given as nameservers. The last name server is silently ignored if this would create a configuration with more than three servers. The default value is false.

Default value: false

resolv_conf_file

Data type: Stdlib::Absolutepath

The absolute path of the file to manage. The default is /etc/resolv.conf. In general it does not make sense to change this parameter.

owner

Data type: Optional[String]

The owner of the file /etc/resolv.conf. The default is root.

Default value: undef

group

Data type: Optional[String]

The group of the file /etc/resolv.conf. The default is root on Linux and wheel on FreeBSD.

Default value: undef

mode

Data type: Optional[Stdlib::Filemode]

The file mode of the file /etc/resolv.conf. The default is 0644.

Default value: undef