From owner-freebsd-stable Thu Sep 21 18: 1:27 2000 Delivered-To: freebsd-stable@freebsd.org Received: from drugs.dv.isc.org (drugs.dv.isc.org [130.155.191.236]) by hub.freebsd.org (Postfix) with ESMTP id 83E0237B43F; Thu, 21 Sep 2000 18:01:14 -0700 (PDT) Received: from nominum.com (localhost.dv.isc.org [127.0.0.1]) by drugs.dv.isc.org (8.11.0/8.11.0) with ESMTP id e8M12Pi51386; Fri, 22 Sep 2000 12:02:27 +1100 (EST) (envelope-from marka@nominum.com) Message-Id: <200009220102.e8M12Pi51386@drugs.dv.isc.org> To: dima@unixfreak.org Cc: Tim Zingelman , stable@FreeBSD.ORG, current@FreeBSD.ORG From: Mark.Andrews@nominum.com Subject: Re: 'host' command with CNAMEs In-reply-to: Your message of "Thu, 21 Sep 2000 17:14:56 PDT." <20000922001456.5BC6E1F27@static.unixfreak.org> Date: Fri, 22 Sep 2000 12:02:25 +1100 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG BIND 4 and BIND 8 bugs can be reported to bind-bugs@isc.org. BIND 9 bugs can be reported to bind9-bugs@isc.org. Mark P.S. don't bother submitting this as it will just land in my mailbox. > > --ELM969581696-60857-0_ > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > > > > As I recall, Sean Kelly wrote: > > > > I've got two machines here, one running 4.1-STABLE (from Aug 3) and a > > > > 5.0-CURRENT (from Aug 10) and both of them show the same issue. When > > > > you use the 'host' command to resolve a CNAME, it will show all the A > > > > records twice: > > > > > > > > (7) smkelly@edgemaster:~$ host www.microsoft.com > > > > www.microsoft.com is a nickname for microsoft.com > > > > microsoft.com has address 207.46.130.45 > > > > microsoft.com has address 207.46.230.218 > > > > microsoft.com has address 207.46.230.219 > > > > microsoft.com has address 207.46.230.218 > > > > microsoft.com has address 207.46.230.219 > > > > microsoft.com has address 207.46.130.45 > > > > It is more complicated than that... the bug only shows up if you specify > > an alias name... > > You are both correct. In fact, it looks like you're stating the exact > same thing. > > The obvious problem is that if 'host' is resolving a CNAME, there are > two independant places which display the real address. My guess is > that at some point, two independant developers decided to change the > way 'host' deals with CNAMEs, but they put their code in different > places. When they commited their code to the CVS repository, there > were no conflicts, and the second one to commit failed to notice that > a part of his code was already implemented. > > This bug was actually fixed in rev. 8.28 of host.c (BIND v8.2.1), but > was resurrected in rev. 8.31 (BIND v8.2.2-REL). Since ISC doesn't > release their CVS logs to the public, I can't find out why this was > done (perhaps a developer commited something based on an earlier rev., > and didn't merge this change). > > If anybody wants it, I've made a patch to correct the problem (see > attached). It applies against src/contrib/bind/bin/host/host.c of > 5-CURRENT (although host.c is the same in RELENG_4, and it applies > cleanly there). I heard somewhere that the contrib/ tree shouldn't > contain local changes, but I'm unclear as to where local changes to > contribited software go, so I made it against that. Once you've > applied it, all you should have to do is `( cd /usr/src/usr.bin/host > && make)`, although I haven't tested that approach. This should also > apply cleanly to host.c of BIND 8.2.3-T5B, as that's what is in > FreeBSD. > > Hope this helps > > -- > Dima Dorfman > Finger dima@unixfreak.org for my public PGP key. > > "When in doubt, use brute force." > -- Ken Thompson > > --ELM969581696-60857-0_ > Content-Type: text/plain; charset=US-ASCII > Content-Disposition: attachment; filename=host-cname.diff > Content-Description: /usr/home/dima/host-cname.diff > Content-Transfer-Encoding: 7bit > > Index: host.c > =================================================================== > RCS file: /usr/cvs/FreeBSD/src/contrib/bind/bin/host/host.c,v > retrieving revision 1.1.1.3 > diff -u -r1.1.1.3 host.c > --- host.c 2000/05/26 07:17:07 1.1.1.3 > +++ host.c 2000/09/21 23:46:26 > @@ -696,8 +696,18 @@ > if (!hp->ad) > if (verbose && isls == 0) > printf("The following answer is not verified as authent > ic by the server:\n"); > - while (--ancount >= 0 && cp && cp < eom) > + while (--ancount >= 0 && cp && cp < eom) { > cp = pr_rr(cp, answer->qb2, stdout, filter); > + /* > + * When we ask for address and there is a CNAME, it > + * seems to return both the CNAME and the address. > + * Since we trace down the CNAME chain ourselves, we > + * don't really want to print the address at this > + * point. > + */ > + if (cname && ! verbose) > + return (1); > + } > } > if (!verbose) > return (1); > > --ELM969581696-60857-0_-- > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message -- Mark Andrews, Nominum Inc. 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark.Andrews@nominum.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message