OK, I have this resolved (no pun intended).  Stefano noticed that one of the
differences between dig and lookup is that dig called

  Name.fromString(nameString, Name.root)

and lookup called

  Name.fromString(nameString)

As a test, I changed lookup.java to call:

  Lookup l = new Lookup(Name.fromString(args[i]), type);

and

  Lookup l = new Lookup(Name.fromString(args[i], Name.root), type);

which demonstrates the change in behavior:

 $ java -cp dnsjava-2.0.2.jar:. newlookup
141.22.88.24.query.bondedsender.org
 141.22.88.24.query.bondedsender.org:
 141.22.88.24.query.bondedsender.org.com.        2993    IN      A
216.234.246.153
 141.22.88.24.query.bondedsender.org.com.        2993    IN      A
216.234.246.154
 141.22.88.24.query.bondedsender.org.com.        2993    IN      A
216.234.246.155
 -----------------------------------------------------
 141.22.88.24.query.bondedsender.org: host not found

So where did ".com" from from?  Well, adding "domain devtech.com" (see `man
resolv.conf`) to /etc/resolv.conf changed the behavior so that it works:

 $ java -cp dnsjava-2.0.2.jar:. newlookup
141.22.88.24.query.bondedsender.org
 141.22.88.24.query.bondedsender.org: host not found
 -----------------------------------------------------
 141.22.88.24.query.bondedsender.org: host not found

Fun fun fun.  Apparently, something was observing:

  domain   Local domain name.
           Most queries for names within this domain can use short
           names relative to the local domain. If no domain entry
           is present, the domain is determined from the local host
           name returned by gethostname(); the domain part is taken
           to be everything after the first `.'. Finally, if the
           host name does not contain a domain part, the root domain
           is assumed.

and picking up the ".com" from my hostname.

        --- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to