From: Pieter Lexis Date: Tue, 16 Jun 2015 12:31:58 +0000 (+0200) Subject: Add SOA record to randombackend X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~21^2~5^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a12ab4d9e97f521224e673e68b73459783de5f84;p=thirdparty%2Fpdns.git Add SOA record to randombackend --- diff --git a/modules/randombackend/randombackend.cc b/modules/randombackend/randombackend.cc index 33a729e7a3..e7b96b7d7a 100644 --- a/modules/randombackend/randombackend.cc +++ b/modules/randombackend/randombackend.cc @@ -1,6 +1,6 @@ /* PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 - 2008 PowerDNS.COM BV + Copyright (C) 2002 - 2015 PowerDNS.COM BV This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -36,47 +36,69 @@ class RandomBackend : public DNSBackend { public: - RandomBackend(const string &suffix="") + RandomBackend(const string &suffix="") { setArgPrefix("random"+suffix); d_ourname=DNSName(getArg("hostname")); + d_want_A=false; + d_want_SOA=false; } bool list(const DNSName &target, int id, bool include_disabled) { return false; // we don't support AXFR } - + void lookup(const QType &type, const DNSName &qdomain, DNSPacket *p, int zoneId) { - if((type.getCode()!=QType::ANY && type.getCode()!=QType::A) || qdomain==d_ourname) // we only know about random.example.com A by default - d_answer=""; // no answer - else { - ostringstream os; - os<