On Sat, 29 Jul 2006, Noel J. Bergman wrote:

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:

[snip]

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:

[snip]

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.

The code in dnsjava's ResolverConfig class should be looking at any "search" or "domain" entries in /etc/resolv.conf, and using them as DNS searchlist entries; that is, suffixes to append to potentially non-absolute domain names. I'm not sure why .com would be appended to a domain name unless there was either a "domain com" or "search com" entry.

There does appear to be a minor bug in dnsjava that search and domain entries should be mutually exclusive; resolv.conf(5) is unclear, but I'm guessing that search should always override domain if present. I can fix that before the dnsjava 2.0.3 release.

You've figured out the problem, and there's nothing wrong in dnsjava here, right?

Brian

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

Reply via email to