From f49cc792fa5d17dbf8150e52c9a16284a12bc2c2 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 20 Sep 2002 20:09:27 +0000 Subject: The resolver library does a pretty acceptable set of domain suffix attempts before failing. No need to try again by hand, particularly when it fills your log with failures because localhost.example.com..example.com fails to resolve. Also improve the log message that helped find this error. There is still (maybe) an uninitialised pointer problem here, but in a month of testing I haven't triggered it. --- usr.sbin/ypserv/yp_dnslookup.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index 016cbb0c..02cdfcf4 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -176,7 +176,7 @@ yp_send_dns_query(char *name, int type) n = res_mkquery(QUERY,name,C_IN,type,NULL,0,NULL,buf,sizeof(buf)); if (n <= 0) { - yp_error("res_mkquery failed"); + yp_error("res_mkquery failed for %s type %d", name, type); return(0); } @@ -386,24 +386,7 @@ yp_run_dnsq(void) hent = __dns_getanswer(buf, rval, q->name, q->type); - /* - * If the lookup failed, try appending one of the domains - * from resolv.conf. If we have no domains to test, the - * query has failed. - */ - if (hent == NULL) { - if ((h_errno == TRY_AGAIN || h_errno == NO_RECOVERY) - && q->domain && *q->domain) { - snprintf(retrybuf, sizeof(retrybuf), "%s.%s", - q->name, *q->domain); - if (debug) - yp_error("retrying with: %s", retrybuf); - q->id = yp_send_dns_query(retrybuf, q->type); - q->ttl = DEF_TTL; - q->domain++; - return; - } - } else { + if (hent != NULL) { if (q->type == T_PTR) { hent->h_addr = (char *)&q->addr.s_addr; hent->h_length = sizeof(struct in_addr); -- cgit v1.1