cookbook 'dnsmasq', '~> 2.0.0'
dnsmasq
(24) Versions
2.0.0
-
Follow10
Provides dnsmasq custom resources for install, DNS, DHCP, and managed hosts
cookbook 'dnsmasq', '~> 2.0.0', :supermarket
knife supermarket install dnsmasq
knife supermarket download dnsmasq
DNSMasq
Install and configure dnsmasq with custom resources.
Maintainers
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
Resources
dnsmasq
Top-level resource that installs the package, enables the service, and can
manage DNS, DHCP, and hosts data in one declaration.
dnsmasq 'default' do enable_dns true enable_dhcp true managed_hosts_data_bag false managed_hosts( '10.0.0.20' => ['router.test.lab', 'router'] ) dns_config( 'server' => '8.8.8.8' ) dhcp_config( 'dhcp-range' => 'eth1,10.0.0.5,10.0.0.15,12h', 'interface' => 'eth1', 'tftp-root' => '/var/lib/tftpboot', 'enable-tftp' => nil ) dhcp_options ['dhcp-host=01:23:ab:cd:01:02,larry,10.0.0.10'] end
dnsmasq_dns
Manages /etc/dnsmasq.d/dns.conf.
dnsmasq_dhcp
Manages /etc/dnsmasq.d/dhcp.conf and the optional TFTP root directory.
dnsmasq_managed_hosts
Manages /etc/hosts entries for dnsmasq, optionally merging a data bag item.
Detailed resource documentation lives in:
documentation/dnsmasq_dnsmasq.mddocumentation/dnsmasq_dns.mddocumentation/dnsmasq_dhcp.mddocumentation/dnsmasq_managed_hosts.md
Data Bag
If you want to merge managed hosts from a data bag, use the dnsmasq data bag
and the managed_hosts item by default. It takes the form:
{
"id": "managed_hosts",
"maps": {
"192.168.0.100": "www.google.com",
"192.168.0.101": ["www.yahoo.com", "www.altavista.com"]
}
}
Notes
- This cookbook no longer uses root-level recipes or attributes.
- Configuration defaults now live on resource properties instead of node attributes.
- Managed hosts still use the
hostsfilecookbook under the hood.
Testing
Please refer to the [TESTING file](TESTING.md) to see instructions for testing this cookbook.
Contributors
This project exists thanks to all the people who contribute.
Backers
Thank you to all our backers!
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
CHANGELOG
This file is used to list changes made in each version of the Dnsmasq cookbooks.
2.0.0 (2026-04-22)
⚠ BREAKING CHANGES
- Fedora and Oracle Linux are no longer included in the automated test matrix for this cookbook.
Features
- add :delete action to dnsmasq resource and fix managed_hosts (d023f46)
- drop fedora and oraclelinux test coverage (a28ae62)
- migrate dnsmasq to resources (7c11816)
- modernize platforms and kitchen config (750430b)
Bug Fixes
- ci: Update workflows to use release pipeline (#108) (d2454c2)
- skip flaky rhel port check (c967c59)
- stabilize dnsmasq CI (a6c78ef)
- stabilize dnsmasq integration suites (db811aa)
- use eth0 instead of eth1 in test recipe for Dokken containers (7b98010)
1.1.15 (2025-10-15)
Bug Fixes
1.1.9 - 2023-09-26
- Fix typo in manage_hostsfile recipe
1.1.1 - 2023-02-14
- Remove delivery folder
1.1.0 - 2021-08-31
- Standardise the tested platforms
1.0.2 - 2021-08-31
- Standardise files with files in sous-chefs/repo-management
1.0.1 - 2021-06-01
- Standardise files with files in sous-chefs/repo-management
1.0.0 - 2021-05-24
- Chef 17 compatibility
- Minimum version of Chef-Infra 15.3
0.3.4
- resolved cookstyle error: recipes/dhcp.rb:8:44 convention:
Layout/TrailingWhitespace - resolved cookstyle error: recipes/dhcp.rb:8:45 refactor:
ChefModernize/FoodcriticComments
0.3.3 - 2020-05-05
- Fix cookstyle warnings in the Dangerfile
- Migrated to github actions
[0.3.2] - 2019-08-13
- systemd-resolved conflict (fixes #35)
[0.3.1] - 2019-05-07
- Switch testing from serverspec to inspec
[0.3.0] - 2019-05-06
- Require Chef 14 as it has builtin hotfle management
- update testing harness to use ServerSpec with Test Kitchen in lieu of MiniTest
- changed to circleci for testing
- add CONTRIBUTING documentation, update TESTING and README documentation
[0.2.0] - 2013-12-23
- 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
- duplicate options support for dhcp and dns conf files, driven by dhcp_options and dns_options attributes
Huge thanks to @mattray!
[0.1.2] - 2013-12-23
- initial version
Collaborator Number Metric
2.0.0 passed this metric
Contributing File Metric
2.0.0 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
2.0.0 passed this metric
No Binaries Metric
2.0.0 passed this metric
Testing File Metric
2.0.0 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 passed this metric
2.0.0 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
2.0.0 passed this metric
No Binaries Metric
2.0.0 passed this metric
Testing File Metric
2.0.0 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 passed this metric
2.0.0 passed this metric
Testing File Metric
2.0.0 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
2.0.0 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
2.0.0 failed this metric
2.0.0 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number