void TinyDNSBackend::getAllDomains(vector<DomainInfo>* domains, bool include_disabled)
{
d_isAxfr = true;
+ d_isGetDomains = true;
d_dnspacket = NULL;
try {
bool TinyDNSBackend::list(const DNSName& target, int domain_id, bool include_disabled)
{
d_isAxfr = true;
+ d_isGetDomains = false;
string key = target.toDNSStringLC();
try {
d_cdbReader = std::unique_ptr<CDB>(new CDB(getArg("dbfile")));
void TinyDNSBackend::lookup(const QType& qtype, const DNSName& qdomain, int zoneId, DNSPacket* pkt_p)
{
d_isAxfr = false;
+ d_isGetDomains = false;
string queryDomain = toLowerCanonic(qdomain.toString());
string key = simpleCompress(queryDomain);
PacketReader pr(val, 0);
rr.qtype = QType(pr.get16BitInt());
+ if (d_isGetDomains && rr.qtype != QType::SOA) {
+ continue;
+ }
+
if (d_isAxfr || d_qtype.getCode() == QType::ANY || rr.qtype == d_qtype) {
char locwild = pr.get8BitInt();
if (locwild != '\075' && (locwild == '\076' || locwild == '\053')) {
}
catch (...) {
g_log << Logger::Error << backendname << "Failed to parse record content for " << rr.qname << " with type " << rr.qtype.toString();
- if (d_ignorebogus) {
+ if (d_ignorebogus || d_isGetDomains) {
g_log << ". Ignoring!" << endl;
continue;
}
DNSPacket* d_dnspacket; // used for location and edns-client support.
bool d_isWildcardQuery; // Indicate if the query received was a wildcard query.
bool d_isAxfr; // Indicate if we received a list() and not a lookup().
+ bool d_isGetDomains{false};
bool d_locations;
bool d_ignorebogus;
string d_suffix;