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


djbdns (34) Versions 4.1.0

Installs djbdns and configures DNS services

cookbook 'djbdns', '= 4.1.0', :supermarket
cookbook 'djbdns', '= 4.1.0'
knife supermarket install djbdns
knife supermarket download djbdns
Quality 100%

djbdns Cookbook

Build Status Cookbook Version

Installs and configures Dan Bernstein's DNS tinydns, aka djbdns. Services are configured to start up under runit.



The following platforms are supported via test kitchen.

  • Ubuntu 12.04 / 14.04
  • Debian 7
  • RHEL

It may work with or without modification on other platforms, particularly using the source install method.


  • Chef 12.1+


  • build-essential - for compiling the source.
  • ucspi-tcp - tcpserver is used by the axfr recipe.
  • runit - for setting up the services.


  • node['djbdns']['tinydns_ipaddress'] - listen address for public facing tinydns server
  • node['djbdns']['tinydns_internal_ipaddress'] - listen address for internal tinydns server
  • node['djbdns']['public_dnscache_ipaddress'] - listen address for public DNS cache
  • node['djbdns']['axfrdns_ipaddress'] - listen address for axfrdns
  • node['djbdns']['public_dnscache_allowed_networks'] - subnets that are allowed to talk to the dnscache.
  • node['djbdns']['tinydns_internal_resolved_domain'] - default domain this tinydns serves
  • node['djbdns']['tinydns_internal_resolved_reverse_domains'] - default domains this tinydns serves
  • node['djbdns']['axfrdns_dir'] - default location of the axfrdns service and configuration, default /etc/djbdns/axfrdns
  • node['djbdns']['tinydns_dir'] - default location of the tinydns service and configuration, default /etc/djbdns/tinydns
  • node['djbdns']['tinydns_internal_dir'] - default location of the tinydns internal service and configuration, default /etc/djbdns/tinydns_internal
  • node['djbdns']['public_dnscache_dir'] - default location of the public dnscache service and configuration, default /etc/djbdns/public-dnscache
  • node['djbdns']['bin_dir'] - default location where binaries will be stored.
  • node['djbdns']['axfrdns_uid'] - default uid for the axfrdns user
  • node['djbdns']['dnscache_uid'] - default uid for the dnscache user
  • node['djbdns']['dnslog_uid'] - default uid for the dnslog user
  • node['djbdns']['tinydns_uid'] - default uid for the tinydns user
  • node['djbdns']['package_name'] - name of the djbdns package. this shouldn't be changed most of the time, but may be necessary to use the Debian fork, dbndns.
  • node['djbdns']['install_method'] - method used to install djbdns, can be package, or source.



Adds a resource record for the specified FQDN.


  • :add: Creates a new entry in the tinydns data file with the add-X scripts in the tinydns root directory.

Attribute Parameters

  • fqdn: name attribute. specifies the fully qualified domain name of the record.
  • ip: ip address for the record.
  • type: specifies the type of entry. valid types are: alias, alias6, childns, host, host6, mx, and ns. default is host.
  • cwd: current working directory where the add scripts and data files must be located. default is the node attribute djbdns[:tinydns_internal_dir], usually /etc/djbdns/tinydns-internal.


djbdns_rr '' do
  ip ''
  type 'host'
  action :add
  notifies :run, 'execute[build-tinydns-internal-data]'

(The resource execute[build-tinydns-internal-data] should run a make in the tinydns root directory (aka cwd).



The default recipe installs djbdns software from package where available, otherwise installs from source. It also sets up the users that will run the djbdns services using the UID's specified by the attributes above. The service type to use is selected based on platform.

The default recipe attempts to install djbdns on as many platforms as possible. It tries to determine the platform's installation method:

  • Debian will install from packages
  • All other distributions will install from source.

Service specific users will be created as system users:

  • dnscache
  • dnslog
  • tinydns


Creates the axfrdns user and sets up the axfrdns service.


Sets up a local DNS caching server.


Sets up a server to be an internal nameserver. To modify resource records in the environment, modify the tinydns-internal-data.erb template, or create entries in a data bag named djbdns, and an item named after the domain, with underscores instead of spaces. Example structure of the data bag:

  "id": "int_example_com",
  "ns": [
    { "": "" },
    { "": "" }
  "alias": [
    { "": "" }
  "host": [
    { "": "" }

Aliases and hosts should be an array of hashes, each entry containing the fqdn as the key and the IP as the value. In this example is the IP of the nameserver and we're listing it as authoritative for and for reverse DNS for 192.168.0.x.


Sets up a server to be a public nameserver. To modify resource records in the environment, modify the tinydns-data.erb template. The recipe does not yet use the data bag per internal_server above, but will in a future release.

License and Author

Copyright 2009-2016, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

djbdns Cookbook CHANGELOG

This file is used to list changes made in each version of the djbdns cookbook.

4.1.0 (2017-01-17)

  • Require the latest compat_resource
  • Switch to Inspec for integration testing
  • Remove RHEL 5 testing as it's near EOL

4.0.0 (2016-12-05)

  • Prevent compile error with source updating method
  • Add ChefSpec matchers
  • Convert LWRP to a custom resource and use compat_resource for 12.1+ compatibility
  • Make sure IPSEND is set so the cache starts
  • Fix Chef 13 compatibility by updating manage_home

3.0.0 (2016-09-15)

  • Testing updates and remove FQDN from templates
  • Update maintainers wording and format [skip-ci]
  • Testing updates
  • Require Chef 12.1+

v2.0.0 (2016-05-20)


This version removes support for bluepill and daemontools init systems and Arch Linux. If you rely on that support you'll want to pin to the 1.2.0 release

This version now manages all djbdns env files to be compatible with the newest runit release. If you manage these files outside of the djbdns recipe you'll need to use the new attributes


  • Removed newlines in configs to prevent restarts
  • Removed inclusion of ucspi-tcp recipe for source installs
  • Convert hashes to Ruby 1.9+ format
  • Bump Runit dependency to 1.6.0 from 1.5.0
  • Updated Test Kitchen config with the latest platforms and a suite for source install
  • Added Travis CI config
  • Added a simple contributing doc to replace the Chef Software Inc version
  • Updated the development gem requirements and break gems into groups in the gemfile
  • Added a cookbook version badge in the readme
  • Added a chefignore file to limit what files are uploaded to the chef server
  • Added additional platforms to the metadata
  • Add source_url and issues_url to the metadata
  • Make modes strings to preserve the leading 0s
  • Resolve rubocop warnings
  • Added additional unit tests


  • Update dependency for current runit cookbook, #7
  • Debian is a source based platform, #9 (see issue for background)
  • Add package_name attribute to allow for installing dbndns, #16, related to #9
  • Use runit as default service type instead of bluepill, #10
  • Drop explicit support for old unsupported Ubuntu versions, #11
  • Manage runit's sv dir for "reasons," #12
  • Remove attributes from metadata, as they're not used for anything anywhere anyway


  • [COOK-2262] - pin runit dependency


  • [COOK-1739] - use node attributes with hash notation instead of just the attribute name (ipaddress, domain) in djbdns attributes file
  • [COOK-1742] - fix foodcritic warnings, use platform_family where apropriate


  • [COOK-1259] - Support local (10.x, 172.x, 192.168.x) reverse lookups in cache


  • [COOK-1042] - Corrected a syntax error in axfr.
  • [COOK-740] - use correct directory for tinydns root data

Previous versions:

The various recipes now support multiple service types. This is controlled with the node[:djbdns][:service_type] attribute, which is set by platform in the default recipe.

ArchLinux support has been added, as well as naively attempting other platforms by source-compiled installation with bluepill for service management.

Collaborator Number Metric

4.1.0 passed this metric

Contributing File Metric

4.1.0 passed this metric

Foodcritic Metric

4.1.0 passed this metric

License Metric

4.1.0 passed this metric

No Binaries Metric

4.1.0 passed this metric

Testing File Metric

4.1.0 passed this metric

Version Tag Metric

4.1.0 passed this metric