Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The dnsmasq-local cookbook has been deprecated

Author provided reason for deprecation:

The dnsmasq-local cookbook has been deprecated and is no longer being maintained by its authors. Use of the dnsmasq-local cookbook is no longer recommended.


dnsmasq-local (12) Versions 2.2.2

Configures a local-only dnsmasq

cookbook 'dnsmasq-local', '~> 2.2.2', :supermarket
cookbook 'dnsmasq-local', '~> 2.2.2'
knife supermarket install dnsmasq-local
knife supermarket download dnsmasq-local
Quality 33%

Dnsmasq Local Cookbook

Cookbook Version
Build Status

Installs Dnsmasq with an opinionated default configuration geared toward
localhost-only improved DNS reliability.


This cookbook currently supports both Debian-based and RHEL-based platforms.

It now requires Chef 12.10+, or Chef 12.1+ and the compat_resource cookbook.


Set the attributes you wish and add the default recipe to your run list, or
create a recipe of your own that implements the included Chef resources.



Installs and configures Dnsmasq in an attribute-driven fashion.



The config attribute hash defaults to empty and can be overridden with settings
to be rendered out to Dnsmasq's .conf file:

default['dnsmasq_local']['config'] = {}

Any option that contains a hyphen should be set as an attribute with an

default['dnsmasq_local']['config']['cache_size'] = 300

Any option that is a boolean with no value can be set to true or false to be
enabled or disabled:

default['dnsmasq_local']['config']['proxy_dnssec'] = true

Any option that can have multiple entries can be set as either an array
(where all entries will be rendered in the config) or a hash (where entries
set to false will not be rendered):

default['dnsmasq_local']['config']['server'] = %w(

default['dnsmasq_local']['config']['server'][''] = true

The options attribute hash defaults to empty and can be overridden with
command line options to run Dnsmasq with. The longform versions of switches
must be used, with the same underscore and boolean rules as for the config:

default['dnsmasq_local']['options']['bind_dynamic'] = true
default['dnsmasq_local']['options']['enable_dbus'] = 'com.example'

The environment attribute hash can be used for setting any other environment
variables that should populate the /etc/default/dnsmasq file:

default['dnsmasq_local']['environment']['IGNORE_RESOLVCONF'] = 'yes'



A parent resource that combines an app + config + service resource.


dnsmasq_local 'default' do
  config(cache_size: 0)
  options(bind_dynamic: true)
  environment(IGNORE_RESOLVCONF: 'yes')
  action :create


Action Description
:create Install, configure, and enable+start Dnsmasq
:remove Stop+disable and remove Dnsmasq


Property Default Description
config nil A Dnsmasq configuration hash
options nil A Dnsmasq command line options hash
environment {} A hash of other environment variables
action :create Action(s) to perform


A resource for installation and removal of the Dnsmasq app packages.


dnsmasq_local_app 'default' do
  action :install


Action Description
:install Install the Dnsmasq package
:upgrade Upgrade the Dnsmasq package
:remove Uninstall the Dnsmasq package


Property Default Description
version nil Install a specific version of the package
action :install Action(s) to perform


A resource for generating Dnsmasq configurations.


dnsmasq_local_config 'default' do
  filename 'dns'
  config(cache_size: 100)
  no_hosts false
  server %w(
  interface(eth0: false, eth1: true)
  action :create


Action Description
:create Write out the Dnsmasq config file
:remove Delete the Dnsmasq config file


Property Default Description
filename Derived from resource name The /etc/dnsmasq.d filename
config See below A complete config hash *
interface '' Listen only on the loopback
cache_size 0 Disable caching
no_hosts true Do not DNSify /etc/hosts
bind_interfaces true Bind only to listening interfaces
query_port 0 Use a static, ephemeral return port
** nil Varies
action :create Action(s) to perform

* A config property that is passed in will override the entirety of the
default config, whereas individual properties passed in will be merged with

** Any unrecognized property that is passed in will be assumed to be a
correct Dnsmasq setting and rendered out to its config. These properties'
values can be true, false, integers, strings, arrays, or hashes.


A resource for the managing the Dnsmasq service.


dnsmasq_local_service 'default' do
  options(bind_dynamic: true)
  enable_dbus 'com.example'
  environment(IGNORE_RESOLVCONF: 'yes')
  action [:create, :enable, :start]


Action Description
:create Set up /etc/default/dnsmasq and any init patches
:remove Remove /etc/default/dnsmasq and any init patches
:enable Enable the service
:disable Disable the service
:start Start the service
:stop Stop the service
:restart Restart the service


Property Default Description
options See below A complete options hash *
* nil Varies
environment {} Other environment variables
action [:create, :enable, :start] Action(s) to perform

* Command line options can be passed in either as one complete options hash,
or as individual property calls for each option.


Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

bastion Applicable Versions

Dnsmasq-Local Cookbook CHANGELOG

This file is used to list changes made in each version of the dnsmasq-local

2.3.0 (2018-05-03)

  • Inherit test configs from a central repo where possible
  • Disable systemd-resolved on Systemd platforms
  • Run integration tests with Microwave

v2.2.1 (2018-04-02)

  • Resolve a new style offense

v2.2.0 (2018-02-09)

  • Resolve all new style offenses
  • Run sub-resources in the main resource's run context instead of root

v2.1.0 (2017-05-20)

  • Run app, config, and service resources in the root run context

v2.0.0 (2017-05-18)

  • BREAKING CHANGE: Drop Chef 11 compatibility, test against Chef 13 and 12
  • BREAKING CHANGE: Change the default config file from dns.conf to default.conf
  • Convert all the HWRPs to Chef custom resources
  • Patch the custom resources for Chef 13 compatibility
  • Support multiple config resources with different filename properties
  • Work around a failure condition with the :remove action on RHEL6
  • Add an environment property and attribute for passing to the service resource

v1.1.0 (2016-08-11)

  • Remove 'proxy-dnssec' as a default setting

v1.0.0 (2016-08-09)

  • Add support for RHEL and RHEL-alike platforms
  • Replace the "environment" attribute/property with command line "options"
  • Add an :upgrade action to the dnsmasq_local_app resource
  • Add a "version" attribute to the dnsmasq_local_app resource
  • Bypass NetworkManager's Dnsmasq management if it's running

v0.5.0 (2016-07-26)

  • Support hashes as config properties

v0.4.0 (2016-06-24)

  • Take over management of the Dnsmasq environment variables
  • Add a warning comment to all Chef-managed config files

v0.3.0 (2016-05-26)

  • Fix custom config properties/attributes under Chef 11
  • Support arrays for config attributes with >1 value (e.g. "server")

v0.2.0 (2016-05-18)

  • Ensure the APT cache is up to date before installing
  • Refactor config merging to avoid attribute collision warnings

v0.1.0 (2016-05-06)

  • Initial release!

v0.0.1 (2016-04-25)

  • Development started

Collaborator Number Metric

2.2.2 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

2.2.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

2.2.2 passed this metric

No Binaries Metric

2.2.2 passed this metric

Testing File Metric

2.2.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

2.2.2 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number