神明達哉 wrote: > At Wed, 12 Aug 2015 07:23:59 -0400, > Andrew Sullivan <a...@anvilwalrusden.com> wrote: > > > > So we are in agreement that glibc's stub resolver is acting really dumb > > > here? > > > > I think that's overstating it. It appears that glibc implemented the > > protocol according to a widely-held but (at least mostly) undocumented > > feature of the protocol. I think my reading of the documents is more > > in line with your interpretation, but as you can see in the thread > > Mark thought "add" meant something obvious. Given the wide deployment > > of glibc, it's rather hard to call it "wrong" -- it's got a running > > code argument, after all. I think this is probably a gap in the > > specification. It's hardly the first one in the DNS. > > FWIW the stub resolver library in BSD variants derived from a very old > version of BIND (ver 4?) has been behaving that way for more than (in > my understanding) several decades: > https://github.com/freebsd/freebsd/blob/master/lib/libc/net/gethostbydns.c > it goes through the answer section in gethostanswer() as a one-pass > operation, replacing the search name with CNAME target as it sees > CNAMEs. I suspect it was implemented way before the first stub > resolver of glibc, and I wouldn't even be surprised if the glibc > implementation referred to the BSD behavior.
The glibc resolver ("libresolv" plus the "nss_dns" module) is a stripped down fork of libbind. It looks like it was first imported into the glibc source tree in May 1993 from BIND 4.9.1 and synchronized periodically with subsequent BIND releases. The last merge was with BIND 8.2.3-T5B in July 2000. Compare https://github.com/freebsd/freebsd/blob/69d8a7bbb6/lib/libc/net/gethostbydns.c#L143 with https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/nss_dns/dns-host.c;h=357ac046932b4e991cd729363a97a3522313b7cc;hb=HEAD#l594 The BSD and glibc stub resolvers behave similarly because they're substantially the same code. -- Robert Edmonds _______________________________________________ DNSOP mailing list DNSOP@ietf.org https://www.ietf.org/mailman/listinfo/dnsop