cookbook 'resolvconf', '= 0.2.0'
resolvconf (15) Versions 0.2.0 Follow6
cookbook 'resolvconf', '= 0.2.0', :supermarket
knife supermarket install resolvconf
knife supermarket download resolvconf
This cookbook maintains /etc/resolv.conf using the resolvconf package, which is installed by default on Debian/Ubuntu.
A system that supports resolvconf.
- Ubuntu >= 10.04
- Debian >= 6.0
Furthermore you need to add the following line to your metadata.rb
This section describes the supported attributes, as well as their default settings.
Use the following attributes to specify your nameserver(s) to use, the search domain(s) and additional options.
Each attribute supports strings, as well as arrays with multiple elements.
node['resolvconf']['nameserver'] = [ '220.127.116.11', '18.104.22.168' ] # Set nameserver(s) to use node['resolvconf']['search'] = node['domain'] # Set domains to search node['resolvconf']['options'] =  # Set options
These attributes specify strings that are included in /etc/resolv.conf at head/body/tail.
node['resolvconf']['head'] = [ '# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)', '# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN' ] node['resolvconf']['base'] =  node['resolvconf']['tail'] = 
By default, the recipe removes any dns-* configuration lines from /etc/network/interfaces,
as they might interferre with the configured settings.
node['resolvconf']['clear-dns-from-interfaces'] = true
The LWRP basically supports all options that can be set via attributes, and uses the same defaults.
It will do the following
- It will create the necessary files in /etc/resolvconf/resolv.conf.d/
- Remove dns-* lines from /etc/network/interfaces (unless clear_dns_form_interfaces is specified)
- Run 'resolvconf -u'
Before using the provider, you probably want to ensure that the resolvconf package is installed.
resolvconf 'custom' do nameserver '22.214.171.124' search 'mydomain.com' options 'rotate' head "# Don't touch this configuration file!" base "# Will be added after nameserver, search, options config items" tail "# This goes to the end of the file." # do not touch my interface configuration plz! clear_dns_from_interfaces false end
Installs the resolvconf package.
Includes resolvconf::install, then configures the node using the specified attributes / defaults.
Contributions are very welcome!
- Fork the repository on Github
- Create a named feature branch (like
- Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License and Authors
Authors: Chris Aumann firstname.lastname@example.org
This cookbook has no specified dependencies.