Date: Thu, 2 May 1996 16:14:31 -0400 (EDT) From: John Capo <jc@irbs.com> To: jgreco@brasil.moneng.mei.com (Joe Greco) Cc: jdp@polstra.com, jgreco@brasil.moneng.mei.com, nate@sri.MT.net, hackers@freebsd.org, freebsd-isp@freebsd.org Subject: Re: Named and Reverse DNS lookups [PATCH] Message-ID: <199605022014.QAA24130@irbs.irbs.com> In-Reply-To: <199605021304.IAA11378@brasil.moneng.mei.com> from Joe Greco at "May 2, 96 08:04:24 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Joe Greco writes:
>
> I had reason to play with it around the time 2.1R came out, I couldn't get
> it to work, and someone on either the BIND list or the domains newsgroup
> confirmed that the BIND in FreeBSD did not support it.
>
> I would be delighted to be proven wrong, of course, because we need things
> like this.
>
The resolver is broken, not BIND. :-(
I've been screwing with this since yesterday thinking it was a DNS
configuration problem. nslookup and dig worked fine but anything
that used the libc resolver did not work right. Too close to the
forest I guess.
Anyway, 1.1.5.1 handles delegated in-addr fine as does Sun0S 4.1.3.
goombay.irbs.com has its in-addr delegated. Traceroute to it from
a 2.1 system and you will probably see this on the console:
gethostby*.gethostanswer: asked for "132.75.182.199.in-addr.arpa",\
got "132.128.75.182.199.in-addr.arpa"
Patch taken from BIND-4.9.3P1 follows.
John Capo jc@irbs.com
IRBS Engineering FreeBSD Servers and Workstations
(954) 792-9551 Unix/Internet Consulting - ISP Solutions
*** /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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605022014.QAA24130>
