Configuration > Resources
resolv.conf
Description
This resource manages the contents of /etc/resolv.conf
, the common resolver configuration file.
Relationship to other resources
The resource catalog of a client may only contain one resolv.conf resource.
Also if there is a file or symlink resource whose path
parameter is /etc/resolv.conf
, the resolv.conf resource depends on it implicitly. However there cannot be both a file resource managing the contents of /etc/resolv.conf
and a resolv.conf resource. The content
and source
parameters of the file resource must be omitted in this case to avoid conflicting resource definitions.
Parameters
To declare a resource within the [[resources]]
array as a resolv.conf resource, set the type
meta-parameter to resolv.conf
.
In addition to the meta-parameters listed in Resources, this table lists all resource-specific parameters:
Name | TOML type | Description | Mandatory | Default |
---|---|---|---|---|
ensure |
string |
Determines the desired state of the resource. One of:
| yes | present |
nameservers |
array of strings | A list of IP addresses that each correspond to a name server. | no | |
search |
array of strings | A search list of domain names for hostname lookup. | no | |
sortlist |
array of strings | A list of IP-address-netmask pairs where the netmask is optional and separated from the IP address part by a slash. | no | |
options |
array of strings |
A list of resolver variables. Each item must be one of:
|
no |
Examples
[[resources]]
type = "resolv.conf"
nameservers = [ "8.8.8.8", "4.4.4.4" ]
search = [ "domain.local", "example.com" ]
sortlist = [ "130.155.160.0/255.255.240.0", "130.155.0.0" ]
options = [ "ndots:2", "timeout:5", "inet6" ]