REC_CONTROL(1)
π rec_control π
okay bestie, so this is rec_control, the command line tool from the PowerDNS Recursor world β it's the little remote control for a recursor that's already out there running. π
β¨ SYNOPSIS β¨
rec_control [OPTION]... COMMAND [COMMAND-OPTION]...
π DESCRIPTION π
rec_control is literally your group chat with a running recursor β you use it to query and control an instance of the PowerDNS Recursor that's already up and vibing. β¨
The way it talks to the recursor is through the controlsocket, which usually lives in /var/run. And here's the tea: the --socket-dir switch β or the --config-dir plus --config-name combo β is what decides which process rec_control actually connects to. π«Ά
πΈ EXAMPLES πΈ
Want to see if the Recursor is even alive? run:
# rec_control ping
Want to stop the recursor by hand? run:
# rec_control quit
Want to dump the caches to disk? execute:
# rec_control dump-cache /tmp/the-cache
NOTE: π¨ Before version 4.5.0, for each command that writes to a file,pdns_recursorwould open the file to write to. Starting with 4.5.0, the files are opened by therec_controlcommand itself using the credentials and the current working directory of the user runningrec_control. A single minus-can be used as a filename to write the data to the standard output stream. π«Ά
π OPTIONS π
--helpβ provide this helpful message. yes bestie, help exists, use it. π--config-dir=<path>β Directory where therecursor.conflives.--config-name=<name>β Name of the virtual configuration.--socket-dir=<path>β Where the controlsocket will live, please use--config-dirinstead.--socket-pid=<pid>β When running in SMP mode, pid ofpdns_recursorto control.--timeout=<num>β Number of seconds to wait for the remote PowerDNS Recursor to respond.--versionβ Show the version number of this program. Note that theversioncommand shows the version of the running recursor. (yes those are two different things, don't get it twisted π)
π COMMANDS π
add-cookies-unsupportedIP [IPβ¦] β Add non-expiring IPs of servers that do not support cookies to the cookie table. Optionally IP:port can be specified, the default is to use port 53. The listed addresses will be placed as Unsupported in the cookie support table and will not be pruned. πadd-dont-throttle-namesNAME [*NAME*β¦] β Add names for nameserver domains that may not be throttled.add-dont-throttle-netmasksNETMASK [*NETMASK*β¦] β Add netmasks for nameservers that may not be throttled.add-ntaDOMAIN [REASON] β Add a Negative Trust Anchor for DOMAIN, suffixed optionally with REASON.add-taDOMAIN DSRECORD β Add a Trust Anchor for DOMAIN with DS record data DSRECORD. This adds the new Trust Anchor to the existing set of Trust Anchors for DOMAIN.current-queriesβ Shows the currently active queries. πclear-cookies[IPβ¦] β Remove entries from cookie table. If IP is*, remove all. Optionally IP:port can be specified, the default is to use port 53.clear-dont-throttle-namesNAME [NAMEβ¦] β Remove names that are not allowed to be throttled. If NAME is*, remove allclear-dont-throttle-netmasksNETMASK [NETMASKβ¦] β Remove netmasks that are not allowed to be throttled. If NETMASK is*, remove allclear-ntaDOMAINβ¦ β Remove Negative Trust Anchor for one or more DOMAINs. Set domain to*to remove all NTA's.clear-ta[DOMAIN]β¦ β Remove Trust Anchor for one or more DOMAINs. Note that removing the root trust anchor is not possible. πdump-cacheFILENAME [TYPEβ¦] β Dumps caches to FILENAME. This file should not exist already, PowerDNS will refuse to overwrite it. While dumping, the recursor might not answer questions.
If no TYPE is specified the record cache, the negative cache, the packet cache and the aggressive NSEC cache are dumped. To select specific caches specify one or more *TYPE*s, separated by spaces. The value of *TYPE can be r, n, p or a.
dump-cookiesFILENAME β Dump the cookie store. πͺdump-dot-probe-mapFILENAME β Dump the contents of the DoT probe map to the FILENAME mentioned.dump-ednsFILENAME β Dumps the EDNS status to the filename mentioned. This file should not exist already, PowerDNS will refuse to overwrite it. While dumping, the recursor will not answer questions.dump-failedserversFILENAME β Dump the contents of the failed server map to the FILENAME mentioned. This file should not exist already, PowerDNS will refuse to overwrite it otherwise. While dumping, the recursor will not answer questions.dump-non-resolvingFILENAME β Dump the contents of the map of nameserver names that did not resolve to an address. This file should not exist already, PowerDNS will refuse to overwrite it otherwise. While dumping, the recursor will not answer questions.dump-nsspeedsFILENAME β Dumps the nameserver speed statistics to the FILENAME mentioned. This file should not exist already, PowerDNS will refuse to overwrite it. While dumping, the recursor will not answer questions. Statistics are kept per thread, and the dumps end up in the same file.dump-rpzZONE NAME FILE NAME β Dumps the content of the RPZ zone named ZONE NAME to the FILENAME mentioned. This file should not exist already, PowerDNS will refuse to overwrite it otherwise. While dumping, the recursor will not answer questions. For details on how RPZ are named seehttps://docs.powerdns.com/recursor/lua-config/rpz.html#policyname.dump-saved-parent-ns-setsFILE NAME β Dump the entries of the map containing saved parent NS sets that were successfully used in resolving. The total number of entries is also printed in the header. An entry is saved if the recursor sees that the parent set includes names not in the child set. This is an indication of a misconfigured domain. π€¨dump-throttlemapFILENAME β Dump the contents of the throttle map to the FILENAME mentioned. This file should not exist already, PowerDNS will refuse to overwrite it otherwise. While dumping, the recursor will not answer questions.getSTATISTIC [STATISTIC]β¦ β Retrieve a statistic. For items that can be queried, seehttps://docs.powerdns.com/recursor/metrics.html.get-allβ Retrieve all known statistics. β¨get-dont-throttle-namesβ Get the list of names that are not allowed to be throttled.get-dont-throttle-netmasksβ Get the list of netmasks that are not allowed to be throttled.get-ntasβ Get a list of the currently configured Negative Trust Anchors.get-tasβ Get a list of the currently configured Trust Anchors.get-parameter[KEY]β¦ β Retrieves the configuration parameter(s). From version 5.4.0 and if YAML configuration is active, KEY is of the formsection[.name]and no keys produces a full dump.get-default-parameter[KEY]β¦ β Retrieves the default values of configuration parameter(s). If YAML configuration is active, KEY is of the formsection[.name]and no keys produces a full dump.get-proxymapping-statsβ Get the list of proxy-mapped subnets and associated counters.get-qtypelistβ Retrieves QType statistics. Queries from cache aren't being counted yet. π«get-remotelogger-statsβ Retrieves the remote logger statistics, per type and address.hash-password[WORK-FACTOR] β Asks for a password then returns the hashed and salted version, to use as a webserver password or API key. This command does not contact the recursor but does the hashing insiderec_control. An optional scrypt work factor can be specified, in power of two. The default is 1024. πhelpβ Shows a list of supported commands understood by the runningpdns_recursor.list-dnssec-algosβ List supported (and potentially disabled) DNSSEC algorithms.pingβ Check if server is alive. πquitβ Request shutdown of the recursor, exiting the process while letting the OS clean up resources.quit-nicelyβ Request nice shutdown of the recursor. This method allows all threads to finish their current work and releases resources before exiting. This is the preferred method to stop the recursor. β¨reload-aclsβ Reloads ACLs.reload-lua-script[FILENAME] β (Re)loads Lua script FILENAME. If FILENAME is empty, attempt to reload the currently loaded script. This replaces the script currently loaded.reload-lua-config[FILENAME] β (Re)loads Lua configuration FILENAME. If FILENAME is empty, attempt to reload the currently loaded file. Note that FILENAME will be fully executed, any settings changed at runtime that are not modified in this file, will still be active. The effects of reloading do not always take place immediately, as some subsystems reload and replace configuration in an asynchronous way. If YAML settings are used this command will reload the runtime settable parts of the YAML settings. πreload-yamlβ Reload the runtime settable parts of the YAML settings.reload-zonesβ Reload authoritative and forward zones. Retains current configuration in case of errors.set-carbon-serverCARBON SERVER [CARBON OURNAME] β Set thecarbon-serversetting to CARBON SERVER. If CARBON OURNAME is not empty, also set thecarbon-ournamesetting to CARBON OURNAME.set-dnssec-log-bogusSETTING β Setdnssec-log-bogussetting to SETTING. Set toonoryesto log DNSSEC validation failures and tonooroffto disable logging these failures.set-ecs-minimum-ttlNUM β Setecs-minimum-ttl-overrideto NUM.set-max-aggr-nsec-cache-sizeNUM β Change the maximum number of entries in the NSEC aggressive cache. If the cache is disabled by setting its size to 0 in the config, the cache size cannot be set by this command. Setting the size to 0 by this command still keeps the cache, but makes it mostly ineffective as it is emptied periodically.set-max-cache-entriesNUM β Change the maximum number of entries in the DNS cache. If reduced, the cache size will start shrinking to this number as part of the normal cache purging process, which might take a while. β³
β¦and bestie, there's more coming, don't you dare close the terminal π
set-max-packetcache-entries NUM
okay so this one changes the max number of entries in the packet cache, bestie. π
heads up though: if you reduce it, the cache size doesn't just snap down instantly β it starts shrinking to this number as part of the normal cache purging process, and that might take a while. so like, be patient, it's doing its thing. π
set-minimum-ttl NUM
sets minimum-ttl-override to NUM. simple as that, no cap. β¨
set-event-trace-enabled NUM
turns logging of event trace messages on/off, and the number decides the vibe:
0= disabled1= protobuf2= log file3= protobuf and log file
show-yaml [FILE]
shows the Yaml representation of the old-style config. πΈ retro but make it yaml.
top-queries
shows the top-20 queries. π statistics are over the last stats-ringbuffer-entries queries.
top-pub-queries
shows the top-20 queries grouped by public suffix list. statistics are over the last stats-ringbuffer-entries queries. π¦
top-largeanswer-remotes
shows the top-20 remote hosts causing large answers. statistics are over the last stats-ringbuffer-entries queries. those big-answer girlies fr fr π
top-remotes
shows the top-20 most active remote hosts. statistics are over the last stats-ringbuffer-entries queries. π
top-servfail-queries
shows the top-20 queries causing servfail responses. statistics are over the last stats-ringbuffer-entries queries. π
top-bogus-queries
shows the top-20 queries causing bogus responses. statistics are over the last stats-ringbuffer-entries queries. π«
top-pub-servfail-queries
shows the top-20 queries causing servfail responses grouped by public suffix list. statistics are over the last stats-ringbuffer-entries queries.
top-pub-bogus-queries
shows the top-20 queries causing bogus responses grouped by public suffix list. statistics are over the last stats-ringbuffer-entries queries.
top-servfail-remotes
shows the top-20 most active remote hosts causing servfail responses. statistics are over the last stats-ringbuffer-entries queries. π
top-bogus-remotes
shows the top-20 most active remote hosts causing bogus responses. statistics are over the last stats-ringbuffer-entries queries.
top-timeouts
shows the top-20 most active downstream timeout destinations. statistics are over the last stats-ringbuffer-entries queries. β³
trace-regex REGEX FILE
emit a resolution trace for matching queries, bestie. no arguments = tracing disabled, periodt. β¨
a little lore for you: before version 4.9.0 there was no FILE argument, and traces were always written to the log. starting with version 4.9.0, trace information gets written to the file you specify β which may be - for the standard out stream. π
queries matching this regular expression will generate voluminous tracing output, so likeβ¦ be aware. π also be aware that matches from the packet cache will still not generate tracing. to unset the regex, pass trace-regex without a new regex.
the regular expression is matched against domain queries terminated with a dot. for example the regex 'powerdns.com$' will not match a query for 'www.powerdns.com', since the attempted match will be with 'www.powerdns.com.'.
in addition, since this is a regular expression, to exclusively match queries for 'www.powerdns.com', one should escape the dots:
'^www\.powerdns\.com\.$'
note that the single quotes prevent further interpretation of the backslashes by the shell. π
multiple matches can be chained with the | operator. for example, to match all queries for Dutch (.nl) and German (.de) domain names, use:
'\.nl\.$|\.de\.$'
unload-lua-script
unloads the Lua script, if one was loaded. bye bestie π«Ά
version
reports the version of the running Recursor. main character energy tbh π
wipe-cache DOMAIN [DOMAIN] [...]
wipe entries for DOMAIN (exact name match) from the cache. π§Ή this is useful if, for example, an important server has a new IP address, but the TTL has not yet expired. multiple domain names can be passed.
DOMAIN can be suffixed with a $ to delete the whole tree from the cache β i.e. powerdns.com$ will remove all cached entries under and including the powerdns.com name. π₯
Note: this command also wipes the negative cache.
Warning: don't just wipe"www.somedomain.com"β its NS records or CNAME target may still be undesired. so wipe"somedomain.com"as well. it's giving "do the whole job", not "half the job". π
wipe-cache-typed qtype DOMAIN [DOMAIN] [...]
same as wipe-cache, but only wipe records of type qtype. π― picky and precise, we love that.
β¨ SEE ALSO β¨
π AUTHOR π
PowerDNS.COM BV
π COPYRIGHT π
PowerDNS.COM BV
and that's the whole page, bestie!! π this one's from PowerDNS.COM BV, dated Oct 05, 2026, and it lives under the name REC_CONTROL(1). go forth and slay your recursor, muah π
β¨π¦
π¦ where this page comes from
- alpine 3.24: pdns-recursor-doc 5.4.8-r0 Β· GPL-2.0-only WITH OpenSSL-Exception
- arch rolling: powerdns-recursor 5.4.8-1 Β· GPL-2.0-only
- epel 10: pdns-recursor 5.4.8-1.el10_3 Β· GPL-2.0-only
- fedora 44: pdns-recursor 5.4.8-1.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms