DONUTS(1)
๐ DONUTS(1) ๐
okay bestie, welcome to the donuts(1) era โ a user-contributed Perl situation, brought to you by the absolute legends over at the dnssec-tools project ๐ฉโจ
โจ NAME โจ
donuts โ she analyzes DNS zone files for errors and warnings. that's it, that's the whole vibe ๐
๐ SYNOPSIS ๐
donuts [-v] [-l LEVEL] [-r RULEFILES] [-i IGNORELIST]
[-C] [-c configfile] [-h] [-H] ZONEFILE DOMAINNAME...
๐ฆ DESCRIPTION ๐ฆ
so donuts is a DNS lint application โ she pokes at DNS zone files looking for particular problems ๐. and this is especially important for zones using DNSSEC security records, because ngl there are SO many subtle problems that can sneak in there ๐ญ.
the default mode of operation assumes you want to check for DNSSEC-related issues. to turn off the invocation of the DNSSEC-related rules, run donuts with -i DNSSEC ๐ซถ
also โ if the Text::Wrap Perl module is installed, donuts will give better output formatting. slay ๐
๐ธ QUERYING LIVE ZONES ๐ธ
okay so ZONEFILE can actually be a live name, prefixed with live: โ and then the records afterwards get queried and analyized as if it was in a zonefile. iconic behavior honestly. for example, running donuts as:
donuts -i NSEC live:badsign-a,good-a test.dnssec-tools.org
will query the test.dnssec-tools.org zone for the badsign-a and good-a records, collect the data, and run them through the donuts analysis ๐ฅ. and because other data is needed as well for the analysis to be useful, donuts will also automatically collect the DNSKEYs, SOAs, and NS records for the zone. and because NSEC records aren't loaded, it is advisable to add that rule exclusion for rules to be run โจ
other data types may be queried by appending a ':' and the type name to a record. for example:
donuts -i NSEC live:good-a,good-aaaa:aaaa test.dnssec-tools.org
๐ QUERYING LIVE ZONES WITH AFXR ๐
if your host is allowed to query for afxr transfers of a particular zone, you may use the afxr: filename token to indicate it should pull the zone data using a AFXR transfer ๐ง
donuts -i NSEC afxr: dnssec-tools.org
๐ OPTIONS ๐
๐ฎ Rule Set Configuration:
-l LEVEL,--level=LEVELโ sets the level of errors to be displayed. the default is level 5. the maximum value is level 9, which displays many debugging results. you probably want to run no higher than level 8 bestie, trust ๐-r RULEFILES,--rules=RULEFILESโ a comma-separated list of rule files to load. the strings will be passed toglob()so*wildcards can be used to specify multiple files ๐
defaults to /usr/share/dnssec-tools/donuts/rules/*.txt and $HOME/.dnssec-tools/donuts/rules/*.txt.
-i IGNORELIST,--ignore=IGNORELISTโ a comma-separated list of regex patterns which are checked against rule names to determine if some should be ignored. run with-vto figure out rule names if you're not sure which rule is generating errors you don't wish to see ๐-f LIST,--features=LISTโ the--featuresoption specifies additional rule features that should be executed. some rules are turned off by default because they are more intensive or require a live network connection, for instance. use the--featuresflag to turn them on โจ theLISTargument should be a comma-separated list. example usage:
--features live,nsec_check
features available in the default rule set distributed with donuts:
liveโ the live feature allows rules that need to perform live DNS queries to run. most of these live rules query parent and children of the current zone, when appropriate, to see that the parent/child relationships have been built properly ๐ณ. for example, if you have aDSrecord which authenticates the key used in a child zone, the live feature will let a rule run which checks to see if the child is actually publishing theDNSKEYthat corresponds to the test zone'sDSrecord ๐nsec_checkโ this checks all theNSECorNSEC3records (as appropriate for the zone) to ensure the chain is complete and that no-overlaps exist. it is fairly memory- and cpu-intensive in large zones โ ๏ธ like, she's eating your CPU bestie, be aware.
๐ Configuration File Options:
-c CONFIGFILE,--config-file=CONFIGFILEโ parse a configuration file to change constraints specified by rules. this defaults to$HOME/.donuts.conf๐-C,--no-configโ don't read user configuration files at all, such as those specified by the-coption or the$HOME/.donuts.conffile. no thoughts, no config, head empty ๐
๐ฆ Extra Live Query Options:
live Queries are enabled through the use of the -f live arguments. these options are only useful if that feature has been enabled ๐
-t INTERFACE,--tcpdump-capture=INTERFACEโ specifies thattcpdumpshould be started on INTERFACE (e.g.,"eth0") just beforedonutsbegins its run of rules for each domain, and will stop it just after it has processed the rules. this is useful when you wish to capture the traffic generated by the live feature, described above ๐ก-T FILTER,--tcpdump-filter=FILTERโ whentcpdumpis run, this FILTER is passed to it for purposes of filtering traffic. by default, this is set toport 53 || ip[6:2] & 0x1fff != 0, which limits the traffic to traffic destined to port 53 (DNS) or fragmented packets ๐ฏ-o FILE,--tcpdump-output-file=FILEโ saves the tcpdump-captured packets to FILE. the following special fields can be used to help generate unique file names:%dโ this is replaced with the current domain name being analyzed (e.g.,"example.com") ๐%tโ this is replaced with the current epoch time (i.e., the number of seconds since Jan 1, 1970) โฐ
this field defaults to %d.%t.pcap.
--show-guiโ [alpha code] ๐ง
displays a browsable GUI screen showing the results of the donuts tests ๐
theQWizardandGtk2Perl modules must be installed for this to work. no modules, no GUI, that's the rule ๐ญ
๐ Help Options
-Hโ displays the personal configuration file rules and tokens that are acceptable in a configuration file. the output will consist of a rule name, a token, and a description of its meaning ๐
your configuration file (e.g., $HOME/.donuts.conf) may have lines in it that look like this:
# change the default minimum number of legal NS records from 2 to 1
name: DNS_MULTIPLE_NS
minnsrecords: 1
# change the level of the following rule from 8 to 5
name: DNS_REASONABLE_TTLS
level: 5
this allows you to override certain aspects of how rules are executed โจ
-Rโ displays a list of all known rules along with their description (if available) ๐-hโ displays a help message ๐ซถ--helpโ displays a help message more tailored to people who prefer long-style options. we see you, long-option girlies ๐-qโ turns on a quieter output mode where only the errors and warnings are shown. IE, the summary line ofN errors found ...is not shown ๐คซ
-q is ignored if a -v argument is present; the -v argument requests a longer output summary and thus it doesn't make sense to use them both at the same time ๐
-vโ turns on more verbose output. multiple-v's will turn on increasing amounts of output. the number of-v's will dictate output ๐ฅ-sโ sorts the resource records so that the order they're processed in is always consistent. if the incoming zone is not always consistently ordered, the output can vary unless the resource records are always in the same order. when sorted, however, they're always evaluated in the same order even if the zone file (or similar) order changes, and thus the output is consistent, making it easier for tools likediffto detect where changes occur in the output ๐ง . this comes at a higher CPU cost, as it takes more time to sort the entries โ ๏ธ
and here's the -v verbosity ladder, bestie, memorize it ๐:
- describes which rules are being loaded and extra detail for rules that found errors (rule Level and extra text detail)
- even more detail about rules that found errors: file name, file line number, rule type
- shows extra detail on the record text being analyzed (the detail is not always available, however)
- even more detail about rules that found errors: dumps the rule code itself
- even more detail about rules that found errors: dumps the internal rule structure
๐ธ Obsolete Options ๐ธ
-Lโ obsolete command line option. please use--features liveinstead ๐ซถ (she's retired, respect her legacy though ๐)
๐ EXAMPLES ๐
run donuts in its default mode on the example.com zone which is contained in the db.example.com file:
% donuts db.example.com example.com
run donuts with significantly more output, both in terms of verbosity and in terms of the number of rules that are run to analyze the file:
% donuts -v -v --level 9 db.example.com example.com
๐ COPYRIGHT ๐
Copyright 2004-2013 SPARTA, Inc. All rights reserved. See the COPYING file included with the DNSSEC-Tools package for details. ๐
๐ฆ AUTHOR ๐ฆ
Wes Hardaker <hardaker@users.sourceforge.net> โ legend behavior, honestly ๐
โญ SEE ALSO โญ
for more information on the dnssec-tools project:
http://www.dnssec-tools.org/
for writing rules that can be loaded by donuts:
Net::DNS::SEC::Tools::Donuts::Rule
general DNS and DNSSEC usage:
Net::DNS, Net::DNS::SEC
that's the whole page bestie ๐ฉ๐ this beauty ships as perl v5.44.0, dated 2026-10-17 โ go forth and lint those zones, you're gonna slay โจ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: dnssec-tools 2.2.3-16 ยท BSD
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms