Date: Tue, 21 May 1996 02:14:26 -0400 (EDT) From: John Capo <jc@irbs.com> To: nate@sri.MT.net (Nate Williams) Cc: hackers@FreeBSD.org Subject: Re: DNS question Message-ID: <199605210614.CAA22689@irbs.irbs.com> In-Reply-To: <199605200307.VAA04583@rocky.sri.MT.net> from Nate Williams at "May 19, 96 09:07:58 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams writes:
>
> Name: ns.mt.sri.com
> Address: 206.127.76.97
> Aliases: 97.76.127.206.in-addr.arpa
>
> > gateway:/etc/namedb/new # host 206.127.76.97
> Host not found, try again.
>
I'll bet you have some log messages that look sort of like this:
host: gethostby*.gethostanswer: asked for "131.75.182.199.in-addr.arpa", \
got "131.128.75.182.199.in-addr.arpa"
The libc resolver is broken for non-terminal in-addr lookups.
*** /usr/stable/src/lib/libc/net/gethostbydns.c Tue Apr 30 22:21:09 1996
--- lib/libc/net/gethostbydns.c Thu May 2 15:57:38 1996
***************
*** 186,192 ****
--- 186,194 ----
int haveanswer, had_error;
int toobig = 0;
char tbuf[MAXDNAME+1];
+ const char *tname;
+ tname = qname;
host.h_name = NULL;
eom = answer->buf + anslen;
/*
***************
*** 277,282 ****
--- 279,303 ----
buflen -= n;
continue;
}
+ if (qtype == T_PTR && type == T_CNAME) {
+ n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
+ if (n < 0) {
+ had_error++;
+ continue;
+ }
+ cp += n;
+ /* Get canonical name. */
+ n = strlen(tbuf) + 1; /* for the \0 */
+ if (n > buflen) {
+ had_error++;
+ continue;
+ }
+ strcpy(bp, tbuf);
+ tname = bp;
+ bp += n;
+ buflen -= n;
+ continue;
+ }
if (type != qtype) {
/* CNAME->PTR should not cause a log message. */
if (!(qtype == T_PTR && type == T_CNAME))
***************
*** 289,295 ****
}
switch (type) {
case T_PTR:
! if (strcasecmp(qname, bp) != 0) {
syslog(LOG_NOTICE|LOG_AUTH,
AskedForGot, qname, bp);
cp += n;
--- 310,316 ----
}
switch (type) {
case T_PTR:
! if (strcasecmp(tname, bp) != 0) {
syslog(LOG_NOTICE|LOG_AUTH,
AskedForGot, qname, bp);
cp += n;
John Capo jc@irbs.com
IRBS Engineering FreeBSD Servers and Workstations
(954) 792-9551 Unix/Internet Consulting - ISP Solutions
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605210614.CAA22689>
