--- /dev/null
+# PowerDNS Internals
+PDNS is normally launched by the init.d script but is actually a binary called `pdns_server`. This file is started by the **start** and **monitor** commands to the init.d script. Other commands are implemented using the controlsocket.
+
+# Controlsocket
+The controlsocket is the means to contact a running PDNS daemon, or as we now know, a running `pdns_server`. Over this sockets, instructions can be sent using the `pdns_control` program. Like the `pdns_server`, this program is normally accessed via the init.d script.
+
+# `pdns_control`
+To communicate with PDNS over the controlsocket, the `pdns\_control` command is used. The init.d script also calls pdns\_control. The syntax is simple: `pdns\_control command arguments`. Currently this is most useful for telling backends to rediscover domains or to force the transmission of notifications. See [Master](../authoritative/modes-of-operation.md#master).
+
+Besides the commands implemented by the init.d script, for which see [Running The Authoritative Server](../authoritative/installation.md), the following `pdns_control` commands are available:
+
+## `ccounts`
+Returns counts on the contents of the cache.
+
+## `current-config`
+Retrieves the current configuration settings from the PDNS instance. This can be useful to generate a from a running instance.
+
+The output has the same format as `pdns_server --config`. You'll notice that all the are uncommented. This is because PDNS simply has values, and the default isn't known at runtime.
+
+## `cycle`
+Restart a PowerDNS instance. Only available when running in guardian mode.
+
+## `notify DOMAIN`
+Adds a domain to the notification list, causing PDNS to send out notifications to the nameservers of a domain. Can be used if a slave missed previous notifications or is generally hard of hearing.
+
+## `notify-host DOMAIN HOST`
+Same as above but with operator specified IP address as destination, to be used if you know better than PowerDNS.
+
+## `ping`
+'PING' the powerdns-guardian. Will return 'PONG' when it is available. (Only works when you are running in guardian mode)
+
+## `purge`
+Purges the entire Packet Cache - see [Authoritative Server Performance](../authoritative/performance.md).
+
+## `purge RECORD`
+Purges all entries for this exact record name - see [Authoritative Server Performance](../authoritative/performance.md).
+
+## `purge RECORD`
+Purges all cache entries ending on this name, effectively purging an entire domain - see [Authoritative Server Performance](../authoritative/performance.md).
+
+## `purge`
+Purges the entire Packet Cache - see [Authoritative Server Performance](../authoritative/performance.md).
+
+## `rping`
+'PING' the powerdns-instance. Will return 'PONG' when it is available.
+
+## `rediscover`
+Instructs backends that new domains may have appeared in the database, or, in the case of the Bind backend, in named.conf.
+
+## `reload`
+Instructs backends that the contents of domains may have changed. Many backends ignore this, the Bind backend will check timestamps for all zones (once queries come in for it) and reload if needed.
+
+## `retrieve DOMAIN`
+Retrieve a slave domain from its master. Done nearly immediately.
+
+## `set VARIABLE VALUE`
+Set a configuration parameter. Currently only the 'query-logging' parameter can be set.
+
+## `uptime`
+Reports the uptime of the daemon in human readable form.
+
+## `show VARIABLE`
+Show a specific statistic. Use \* for all. (You may need to quote as '\*' or \\\*).
+
+## `version`
+Returns the version of a running pdns daemon.
+
+## `status`
+Retrieves the status of PowerDNS. Only available when running with guardian.
All backends which implement this feature must make sure that they can handle transactions so as to not leave the zone in a half updated state. MySQL configured with either BerkeleyDB or InnoDB meets this requirement, as do PostgreSQL and Oracle. The Bindbackend implements transaction semantics by renaming files if and only if they have been retrieved completely and parsed correctly.
-Slave operation can also be programmed using several [`pdns_control`](../appendix/pdns-internals.md#pdnscontrol) commands. The `retrieve` command is especially useful as it triggers an immediate retrieval of the zone from the configured master.
+Slave operation can also be programmed using several [`pdns_control`](internals.md#pdnscontrol) commands. The `retrieve` command is especially useful as it triggers an immediate retrieval of the zone from the configured master.
Since version 2.9.21, PowerDNS supports multiple masters. For the BIND backend, the native BIND configuration language suffices to specify multiple masters, for SQL based backends, list all master servers separated by commas in the 'master' field of the domains table.
Another very important setting is [`cache-ttl`](settings.md#cache-ttl). PDNS caches entire packets it sends out so as to save the time to query backends to assemble all data. The default setting of 20 seconds may be low for high traffic sites, a value of 60 seconds rarely leads to problems.
-Some PDNS operators set cache-ttl to many hours or even days, and use [`pdns_control`](../appendix/pdns-internals.md#pdns_control)` purge` to selectively or globally notify PDNS of changes made in the backend. Also look at the [Query Cache](#query-cache) described in this chapter. It may materially improve your performance.
+Some PDNS operators set cache-ttl to many hours or even days, and use [`pdns_control`](internals.md#pdns_control)` purge` to selectively or globally notify PDNS of changes made in the backend. Also look at the [Query Cache](#query-cache) described in this chapter. It may materially improve your performance.
To determine if PDNS is unable to keep up with packets, determine the value of the [`qsize-q`](../common/logging.md#counters) variable. This represents the number of packets waiting for database attention. During normal operations the queue should be small.
Also, you can force PowerDNS to reload a zone from disk immediately with **pdns\_control bind-reload-now**. All this happens 'live', per your instructions. Without instructions, the right things also happen, but the operator is in charge.
-For more about all this coolness, see [“pdns\_control”](appendix/pdns-internals.md#pdnscontrol "pdns_control") and [“pdns\_control commands”](authoritative/backend-bind.md#bind-control-commands "pdns_control commands").
+For more about all this coolness, see [“pdns\_control”](authoritative/internals.md#pdnscontrol "pdns_control") and [“pdns\_control commands”](authoritative/backend-bind.md#bind-control-commands "pdns_control commands").
**Warning**: Again some changes in compilation instructions. The hybrid pgmysql backend has been split up into 'gmysql' and 'gpgsql', sharing a common base within the PowerDNS server itself. This means that you can no longer compile **--with-modules="pgmysql" --enable-mysql --enable-pgsql** but that you should now use: **--with-modules="gmysql gpgsql"**. The old launch-names remain available.
## New features
- Wildcard CNAMEs now work as expected!
-- **pdns\_control purge** can now also purge based on suffix, allowing operators to purge an entire domain from the packet cache instead of only specific records. See also [pdns\_control](appendix/pdns-internals.md#pdnscontrol "pdns_control") Thanks to Mike Benoit for this suggestion.
+- **pdns\_control purge** can now also purge based on suffix, allowing operators to purge an entire domain from the packet cache instead of only specific records. See also [pdns\_control](authoritative/internals.md#pdnscontrol "pdns_control") Thanks to Mike Benoit for this suggestion.
- **soa-serial-offset** for installations with small SOA serial numbers wishing to register .DE domains with DENIC which demands six-figure SOA serial numbers. See also [Chapter 21, *Index of all Authoritative Server settings*](authoritative/settings.md "Index of all Authoritative Server settings").
# Version 2.1
- [authoritative/installation.md, 'Authoritative', 'Installing and Running']
- [authoritative/upgrading.md, 'Authoritative', 'Upgrading']
- [authoritative/modes-of-operation.md, 'Authoritative', 'Modes of Operation']
+ - [authoritative/internals.md, 'Authoritative', 'Internals']
- [authoritative/virtual.md, 'Authoritative', 'Virtual Hosting']
- [authoritative/fancy-records.md, 'Authoritative', 'Fancy Records']
- [authoritative/performance.md, 'Authoritative', 'Performance Tuning and Monitoring']
- [security/powerdns-advisory-2006-02.md, 'Security', 'Advisory 2006-02']
- [security/powerdns-advisory-2006-01.md, 'Security', 'Advisory 2006-01']
- [appendix/backend-writers-guide.md, 'Tools and Appendices', "Backend Writer's Guide"]
- - [appendix/pdns-internals.md, 'Tools and Appendices', 'PowerDNS Internals']
- [appendix/compiling-powerdns.md, 'Tools and Appendices', 'Compiling PowerDNS']
- [tools/analysis.md, 'Tools and Appendices', 'DNS Analysis Tools']