aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/yp_dnslookup.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2002-09-20 20:09:27 +0000
committerMark Murray <markm@FreeBSD.org>2002-09-20 20:09:27 +0000
commit15b23bddd9886d67631aff39d095af47415771dc (patch)
tree5e40d2ae3f6efab0bd16530aaf097fc58857b16e /usr.sbin/ypserv/yp_dnslookup.c
parent492d981b7a1ce58797298c458ec7f35b2abedd88 (diff)
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.
Notes
Notes: svn path=/head/; revision=103717
Diffstat (limited to 'usr.sbin/ypserv/yp_dnslookup.c')
-rw-r--r--usr.sbin/ypserv/yp_dnslookup.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c
index 016cbb0c483b..02cdfcf4faa3 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);