return str;
}
+string strrcode(unsigned char rcode)
+{
+ static const char* rcodes[]={"No Error", "FormErr", "SERVFAIL", "NXDOMAIN", "NotImp", "Refused", "", "", "", "Not Auth"};
+ if((rcode < sizeof(rcodes) / sizeof(*rcodes)) && *rcodes[rcode])
+ return rcodes[rcode];
+ return "Err#"+lexical_cast<string>((int)rcode);
+}
/** for use by DNSPacket, converts a SOAData class to a ascii line again */
string serializeSOAData(const SOAData &data);
string &attodot(string &str); //!< for when you need to insert an email address in the SOA
-
+string strrcode(unsigned char rcode);
#endif
*domain = stripDot(mdp.d_qname);
if(mdp.d_answers.empty())
- throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' produced no results");
+ throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' produced no results (error code: "+strrcode(mdp.d_header.rcode)+")");
if(mdp.d_qtype != QType::SOA)
throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' returned wrong record type");