Browse files

replace dots in hostname by underscores for carbon reporting, and doc…

…ument this.
  • Loading branch information...
1 parent 73d97f7 commit 46541751ed1c3bc051d78217543d5fc76733e212 @ahupowerdns ahupowerdns committed Dec 25, 2014
Showing with 19 additions and 2 deletions.
  1. +1 −0 pdns/
  2. +12 −1 pdns/docs/markdown/common/
  3. +5 −1 pdns/docs/markdown/recursor/
  4. +1 −0 pdns/
@@ -39,6 +39,7 @@ try
char *p = strchr(tmp, '.');
if(p) *p=0;
+ boost::replace_all(hostname, ".", "_");
BOOST_FOREACH(const string& entry, entries) {
str<<"pdns."<<hostname<<".auth."<<entry<<' '<<<<' '<<now<<"\r\n";
@@ -129,8 +129,19 @@ LegendI[recursing]: recursing-answers
## Sending to Carbon/Graphite/Metronome
For carbon/graphite/metronome, we use the following namespace. Everything starts with 'pdns.', which is then followed by the local hostname. Thirdly, we add either 'auth' or 'recursor' to siginify the daemon generating the metrics. This is then rounded off with the actual name of the metric. As an example: 'pdns.ns1.recursor.questions'.
+**Warning**: If your hostname includes dots, beyond 3.6.2 they will be
+replaced by underscores so as not to confuse the namespace. In 3.6.2 and earlier,
+any dots will remain unchanged. See below for how to override the hostname.
Care has been taken to make the sending of statistics as unobtrusive as possible, the daemons will not be hindered by an unreachable carbon server, timeouts or connection refused situations.
To benefit from our carbon/graphite support, either install Graphite, or use our own lightweight statistics daemon, Metronome, currently available on [GitHub](
-Secondly, set [`carbon-server`](../authoritative/, possibly [`carbon-interval`](../authoritative/ and possibly [`carbon-ourname`](../authoritative/ in the configuration.
+Secondly, set [`carbon-server`](../authoritative/,
+possibly [`carbon-interval`](../authoritative/
+and possibly [`carbon-ourname`](../authoritative/
+in the configuration.
+**Warning**: If you include dots in `carbon-ourname`, they will not be replaced by underscores,
+since PowerDNS assumes you know what you are doing if you override your hostname.
@@ -20,7 +20,11 @@ Authoritative zones can transmit a TTL value that is lower than that specified i
Comma separated list of 'zonename=filename' pairs. Zones read from these files (in BIND format) are served authoritatively. Example: `,`. Available since version 3.1.
## `carbon-ourname`
-If sending carbon updates, if set, this will override our hostname. See ["PowerDNS Metrics"](../common/ Available beyond 3.5.3.
+If sending carbon updates, if set, this will override our hostname. Be
+careful not to include any dots in this setting, unless you know what you
+are doing. See ["PowerDNS Metrics"](../common/
+Available beyond 3.5.3.
## `carbon-server=...`
If set to an IP or IPv6 address, will send all available metrics to this server via the carbon protocol, which is used by graphite and metronome. See ["PowerDNS Metrics"](../common/ Available beyond 3.5.3.
@@ -42,6 +42,7 @@ try
if(p) *p=0;
+ boost::replace_all(hostname, ".", "_");
BOOST_FOREACH(const all_t::value_type& val, all) {
str<<"pdns."<<hostname<<".recursor."<<val.first<<' '<<val.second<<' '<<now<<"\r\n";

0 comments on commit 4654175

Please sign in to comment.