Subject: Re: dig not working?
To: None <mrg@eterna.com.au>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: current-users
Date: 03/31/1996 19:57:36
Michael VanLoon writes:
> Here's an illustration of the broken NetBSD-current dig.  Others have
> acknowledged its brokenness, so I'm sure it's just a matter of time
> until someone who knows what they're doing decides to figure out
> what's wrong and fix it.

DiG isn't working because it needs a res_send.o et al. compiled with -DDEBUG.

DiG needs to either be linked with "-lresolv" or else the resolver routines
that are in libc (which DiG is picking up, since it doesn't use "-lresolv")
need to have "-DDEBUG" added to their compilation flags, which might be a
bit hairy to add.  ("-DDEBUG" *is* used when compiling these modules to build
libresolv, but not then they're compiled as part of libc.)

I'd rather leave it up to Matthew to decide what the right solution is.

(I note with interest that nothing in the tree uses "-lresolv" anymore.
 Not even "nslookup".  On the other hand, res_init.c only exists in libc and
 not in libresolv; it has "#ifdef DEBUG" statements in it but it's not
 compiled with "-DDEBUG".)

That said, a couple of things I noticed:

 - /usr/src/lib/libc/net/res_debug.c::__p_option() ought to have an entry
   to print "d2" (or "debug2", if you prefer) if RES_DEBUG2 is set in the
   resolver options.

 - DiG doesn't supply res_mkquery() with a FQHN.  There used to be code in
   res_mkquery() to tack on _res.defdname if the supplied "dname" parameter
   had no dots in it (i.e., unqualified), but that disappeared.  resolver(3)
   says that the "dname" parameter is a "specified fully-qualified domain
   name".  So I guess DiG needs to be changed to fully-qualify the names it
   supplies.  (The old code in res_mkquery() to do this could be used; find
   an old res_mkquery.c like "6.7 (Berkeley) 3/7/88")

	- Greg