cookbook 'resolvconf', '= 0.2.9', :supermarket
resolvconf (15) Versions 0.2.9 Follow6
cookbook 'resolvconf', '= 0.2.9'
knife cookbook site install resolvconf
knife cookbook site 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'] = %w(18.104.22.168 22.214.171.124) # Set nameserver(s) to use node['resolvconf']['search'] = node['domain'] # Set domains to search node['resolvconf']['options'] =  # Set options node['resolvconf']['sortlist'] = ['126.96.36.199/255.255.240.0 188.8.131.52'] # Default is empty
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
You can force the resolvconf cookbook to wipe old entries from the runtime directories. Use this if you have trouble with old resolv.conf entries ending up in your configuration. This is not enabled by default, as it removes the dynamic capabilities of resolvconf which enable applications to change nameserver settings on the fly.
node['resolvconf']['wipe-runtime-directory'] = false
You can set a list of interfaces that you want to inherit the dns settings from. It creates the
interface-order file /etc/resolvconf/interface-order and builds it from the list.
This enables you to control which additional dns servers if any are added from which interfaces.
node['resolvconf']['interface-order'] = [
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
- Run 'resolvconf -u'
Before using the provider, you probably want to ensure that the resolvconf package is installed.
resolvconf 'custom' do nameserver '184.108.40.206' search 'mydomain.com' options 'rotate' sortlist 'mysortlist' 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.
CHANGELOG for resolvconf
This file is used to list changes made in each version of resolvconf.
use_inline_resourcesto fix a bug with
resolvconf -unot being immediately called.
wipe_runtime_directoryto be specified as resource attribute. Defaults to node attribute.
- Add support for interface-order
- Make sure
/etc/resolv.confis a symlink to
/run/resolvconf/interface/is wiped only when
node['resolvconf']['wipe-runtime-directory']is set to
true. Defaults to false. This resolves issues with applications using the dynamic nameserver configuration capabilities of resolvconf.
- Include a workaround for Ubuntu-10.04 (Debian bug #642222)
- Remove support for the domain attribute, as resolvconf ignores it. Use search attribute instead.
- Add support for sortlist and domain settings
- Remove a workaround for
force_unlink, fix was merged in Chef 11.12.0
/run/resolvconf/interface/directory before updating
/etc/resolv.conf, to prevent deprecated entries from ending up in the file
- Add small workaround for
force_unlinkbug in Chef, fixed (but not released) in https://github.com/opscode/chef/pull/1383
- Remove potential symlinks before deploying new configuration
- Add tests (using kitchen, see TESTING.md)
- Run resolvconf --enable-updates before resolvconf -u (when supported)
- Use Chef::Util::FileEdit instead of execute() and sed
- Initial release of resolvconf
0.2.9 passed this metric
0.2.9 passed this metric