To control and query the PowerDNS recursor, the tool rec_control is provided. This program talks to the recursor over the 'controlsocket', often stored in /var/run.
As a sample command, try:
# rec_control ping pong
When not running as root, --socket-dir=/tmp might be appropriate.
All rec_control commands are documented below:
Dumps the entire cache to the filename mentioned. This file should not exist already, PowerDNS will refuse to overwrite it. While dumping, the recursor will not answer questions.
Retrieve a statistic. For items that can be queried, see below.
Check if server is alive.
Request shutdown of the recursor.
Reload data about all authoritative and forward zones. The configuration file is also scanned to see if the auth-domain, forward-domain and export-etc-hosts statements have changed, and if so, these changes are incorporated.
Shows the top-20 most active remote hosts. Statistics are over the last 'remotes-ringbuffer-entries' queries, which defaults to 0.
Wipe entries 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. For versions before 3.1, you must terminate a domain with a .! So to wipe powerdns.org, issue 'rec_control wipe-cache powerdns.org.'. For later versions, the dot is optional.
Note that deletion is exact, wiping 'com.' will leave 'www.powerdns.com.' untouched!
![]() | In PowerDNS versions 3.0.0 and 3.0.1 this command is slightly buggy and might cause your nameserver to crash if the first query after wiping the cache is for the domain you just wiped. |
![]() | Don't just wipe 'www.somedomain.com', its NS records or CNAME target may still be undesired, so wipe 'somedomain.com' as well. |
The command 'get' can query a large number of statistics, which are detailed in Section 12.5.
More details on what 'throttled' queries and the like are can be found below in Section 12.4.