unexpected RCODE (SERVFAIL)
Mark Andrews
Mark_Andrews at isc.org
Fri Jan 19 00:36:24 UTC 2007
> Sorry if you receive this twice, I sent the earlier one from the wrong email
> address and I wasn't sure it the listserv would accept it...
>
> I'm running 9.3.3.
>
> Jan 18 10:00:46 dns-server named[27452]: unexpected RCODE (SERVFAIL)
> resolving '170.252.127.65.in-addr.arpa/PTR/IN': w.x.y.z#53
> Jan 18 10:00:59 dns-server named[27452]: unexpected RCODE (SERVFAIL)
> resolving '244.49.58.82.in-addr.arpa/PTR/IN': w.x.y.z#53
> Jan 18 10:01:26 dns-server named[27452]: unexpected RCODE (SERVFAIL)
> resolving '101.200.213.64.in-addr.arpa/PTR/IN': w.x.y.z#53
>
> I understand what these messages mean, but since this server is set up for
> forward-only, I don't care about them. How do I tell named not to log these?
Try this patch. It should suppress SERVFAIL from forwarders.
Mark
Index: bind9/lib/dns/resolver.c
diff -u bind9/lib/dns/resolver.c:1.340 bind9/lib/dns/resolver.c:1.340.10.1
--- bind9/lib/dns/resolver.c:1.340 Mon Jan 8 01:13:38 2007
+++ bind9/lib/dns/resolver.c Thu Jan 18 23:15:10 2007
@@ -1841,7 +1841,7 @@
}
static void
-add_bad(fetchctx_t *fctx, isc_sockaddr_t *address, isc_result_t reason) {
+add_bad(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, isc_result_t reason) {
char namebuf[DNS_NAME_FORMATSIZE];
char addrbuf[ISC_SOCKADDR_FORMATSIZE];
char classbuf[64];
@@ -1850,6 +1850,7 @@
isc_buffer_t b;
isc_sockaddr_t *sa;
const char *sep1, *sep2;
+ isc_sockaddr_t *address = &addrinfo->sockaddr;
if (bad_server(fctx, address)) {
/*
@@ -1870,6 +1871,11 @@
if (reason == DNS_R_LAME) /* already logged */
return;
+ if (reason == DNS_R_UNEXPECTEDRCODE &&
+ fctx->rmessage->opcode == dns_rcode_formerr &&
+ ISFORWARDER(addrinfo))
+ return;
+
if (reason == DNS_R_UNEXPECTEDRCODE) {
isc_buffer_init(&b, code, sizeof(code) - 1);
dns_rcode_totext(fctx->rmessage->rcode, &b);
@@ -3441,7 +3447,7 @@
if (result == ISC_R_SUCCESS)
dns_db_detachnode(fctx->cache, &node);
result = vevent->result;
- add_bad(fctx, &addrinfo->sockaddr, result);
+ add_bad(fctx, addrinfo, result);
isc_event_free(&event);
UNLOCK(&fctx->res->buckets[fctx->bucketnum].lock);
if (!ISC_LIST_EMPTY(fctx->validators))
@@ -5830,7 +5836,7 @@
* Add this server to the list of bad servers for
* this fctx.
*/
- add_bad(fctx, &addrinfo->sockaddr, broken_server);
+ add_bad(fctx, addrinfo, broken_server);
}
if (get_nameservers) {
@@ -5912,7 +5918,7 @@
fctx_done(fctx, result);
} else if (result == DNS_R_CHASEDSSERVERS) {
unsigned int n;
- add_bad(fctx, &addrinfo->sockaddr, result);
+ add_bad(fctx, addrinfo, result);
fctx_cancelqueries(fctx, ISC_TRUE);
fctx_cleanupfinds(fctx);
fctx_cleanupforwaddrs(fctx);
--
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews at isc.org
More information about the bind-users
mailing list