Permalink
Browse files

add default for SOA contact e-mail

  • Loading branch information...
1 parent 159fe44 commit c87f987e98813056d5fead93f0fccb62378d7fcf @mind04 mind04 committed with mind04 Feb 19, 2013
Showing with 10 additions and 2 deletions.
  1. +1 −0 pdns/common_startup.cc
  2. +9 −2 pdns/dnsbackend.cc
@@ -67,6 +67,7 @@ void declareArguments()
::arg().set("wildcard-url","Process URL and MBOXFW records")="no";
::arg().set("loglevel","Amount of logging. Higher is more. Do not set below 3")="4";
::arg().set("default-soa-name","name to insert in the SOA record if none set in the backend")="a.misconfigured.powerdns.server";
+ ::arg().set("default-soa-mail","mailadres to insert in the SOA record if none set in the backend")="";
::arg().set("distributor-threads","Default number of Distributor (backend) threads to start")="3";
::arg().set("signing-threads","Default number of signer threads to start")="3";
::arg().set("receiver-threads","Default number of Distributor (backend) threads to start")="1";
View
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include "dnspacket.hh"
+#include "dns.hh"
string DNSBackend::getRemote(DNSPacket *p)
{
@@ -236,8 +237,14 @@ bool DNSBackend::getSOA(const string &domain, SOAData &sd, DNSPacket *p)
if(sd.nameserver.empty())
sd.nameserver=arg()["default-soa-name"];
- if(sd.hostmaster.empty())
- sd.hostmaster="hostmaster."+domain;
+ if(sd.hostmaster.empty()) {
+ if (!arg().isEmpty("default-soa-mail")) {
+ sd.hostmaster=arg()["default-soa-mail"];
+ attodot(sd.hostmaster);
+ }
+ else
+ sd.hostmaster="hostmaster."+domain;
+ }
if(!sd.serial) { // magic time!
DLOG(L<<Logger::Warning<<"Doing soa serialnumber autocalculation for "<<rr.qname<<endl);

0 comments on commit c87f987

Please sign in to comment.