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


dnsmasq (22) Versions 0.3.1

Installs and configures dnsmasq

cookbook 'dnsmasq', '= 0.3.1', :supermarket
cookbook 'dnsmasq', '= 0.3.1'
knife supermarket install dnsmasq
knife supermarket download dnsmasq
Quality 100%


Cookbook Version
Build Status

Install and configure dnsmasq.



Installs the dnsmasq package. Depending on the [:dnsmasq][:enable_dns] and [:dnsmasq][:enable_dhcp] attributes it includes the dns and dhcp recipes respectively.


Includes the default recipe and writes the contents of the node[:dnsmasq][:dhcp] attribute hash to /etc/dnsmasq.d/dhcp.conf. Here is an example of the necessary attributes for DHCP with TFTP enabled:

'dnsmasq' => {
  'enable_dhcp' => true,
  'dhcp' => {
    'dhcp-authoritative' => nil,
    'dhcp-range' => 'eth0,,,12h',
    'dhcp-option' => '3', #turns off everything except basic DHCP
    'domain' => 'lab.atx',
    'interface' => 'eth0',
    'dhcp-boot' => 'pxelinux.0',
    'enable-tftp' => nil,
    'tftp-root' => '/var/lib/tftpboot',
    'tftp-secure' => nil


Includes the default and manage_hostsfile recipes, then writes the content of the node[:dnsmasq][:dns] attribute hash to /etc/dnsmasq.d/dns.conf.


Loads the dnsmasq data bag managed_hosts item and merges it with any nodes in the [:dnsmasq][:managed_hosts] attribute, then writes them out to /etc/hosts/ via the hosts_file cookbook.


Data Bag

If you need manage your DNS hosts you may use the dnsmasq data bag managed_hosts item. It takes the form:

    "id": "managed_hosts",
    "maps": {
      "": "",
      "": ["", ""]


  • [:dnsmasq][:enable_dns] whether to enable the DNS service, default is true
  • [:dnsmasq][:enable_dhcp] whether to enabled the DHCP service, default is false
  • [:dnsmasq][:managed_hosts] hash of IPs and hostname/array of hostnames for the manage_hostfile recipe, default is empty
  • [:dnsmasq][:managed_hosts_bag] name of the data bag item, default is managed_hosts
  • [:dnsmasq][:dhcp] = hash of settings and values for the /etc/dnsmasq.d/dhcp.conf, default is empty
  • [:dnsmasq][:dhcp_options] = list of options to be added to the /etc/dnsmasq.d/dhcp.conf (ie. ['dhcp-host=80:ee:73:0a:fa:d9,crushinator,']), default is empty.
  • [:dnsmasq][:dns] hash of settings and values for the /etc/dnsmasq.d/dns.conf, defaults are
  'no-poll' => nil,
  'no-resolv' => nil,
  'server' => ''
  • [:dnsmasq][:dns_options] = list of options to be added to the /etc/dnsmasq.d/dns.conf, default is empty.


Please refer to the [TESTING file]( to see instructions for testing this cookbook. It is currently tested on the following platforms: CentOS 5.9, CentOS 6.4, Debian 7.1, Ubuntu 10.04, 12.04 and 13.04.


This project exists thanks to all the people who contribute.


Thank you to all our backers!


Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

pentester Applicable Versions

Dnsmasq Cookbook CHANGELOG

This file is used to list changes made in each version of the Dnsmasq cookbooks.


  • Switch testing from serverspec to inspec


  • Require Chef 14 as it has builtin hotfle management
  • update testing harness to use ServerSpec with Test Kitchen in lieu of MiniTest
  • add CONTRIBUTING documentation, update TESTING and README documentation
  • changed to circleci for testing


  • duplicate options support for dhcp and dns conf files, driven by dhcp_options and dns_options attributes
  • TFTP support
  • Test Kitchen 1.0 coverage for Red Hat 5.9, 6.4, Debian 7.1 and Ubuntu 10.04, 12.04 and 13.04
  • Huge thanks to @mattray!


  • initial version

Collaborator Number Metric

0.3.1 passed this metric

Contributing File Metric

0.3.1 passed this metric

Foodcritic Metric

0.3.1 passed this metric

No Binaries Metric

0.3.1 passed this metric

Testing File Metric

0.3.1 passed this metric

Version Tag Metric

0.3.1 passed this metric