[solved?] Re: [jcifs] NbtAddress.getByName() failing when I use a hostname.]

Michael B. Allen mballen at erols.com
Wed Sep 26 08:55:20 EST 2001


On Mon, Sep 24, 2001 at 07:19:56PM -0700, Rob Wygand wrote:
> This issue doesn't seem to want to die for me.
> 
> I made some changes in my code today in the way that I use JCIFS. 
> Particularly, I switched from using the NBT name in the URL to create an 
> SmbFile to a domain name. So:
> 
> 	smb://WORKGROUP;rob:password@pickle/
> became
> 	smb://WORKGROUP;rob:password@pickle.filefish.com/

Huh? What do you mean it 'became'. Do you mean that 'filefish.com' was
automatically appended to the CIFS domain 'pickle'? I don't see how that
could happen. If you mean that /you/ added it, then that's not how this
stuff works and we need to have a long talk :~)

You know, mixing Nbt with DNS is a Bad Thing. You should pick one
or the other and stick to it. Primarily you should stick to netbios
names. Then, if that fails, let it fall through to trying DNS. If you
know that NetBIOS is going to fail (because you know there is no WINS,
etc) then put DNS in the front of the resolveOrder.

Mike

> This worked once or twice, and then started throwing exceptions claiming 
> that PICKLE.FILEFISH could not be resolved. You'd said that SmbFile does 
> all the magical stuff of resolving hostnames to NBT names, but as soon 
> as I changed the URL to use the ip address (via 
> InetAddress.getHostAddress()) everything started working again and 
> hasn't displayed any problems all day...
> 
> Just a heads up,
> rjw
> 
> Michael B. Allen wrote:
> > On Mon, Sep 17, 2001 at 09:51:16AM -0700, Kammy Wesley wrote:
> > 
> >>We put in ocean.filefish.com.  The NbtAddress is translating that into 
> >>"OCEAN.FILEFISH."
> >>
> > 
> > Ahh, it just hit me. That's not a netbios name so you can't use it
> > with _NbtAddress). The SmbFile class uses SmbURL to do all that extra name
> > resolution stuff with DNS and such. Maybe you can do:
> > 
> > NbtAddress a = NbtAddress.getByName((new SmbFile( whatevername )).getServer());
> > 
> > Pretty ugly because it does redundant lookups but the name will resolve
> > quickly the second time because it would be cached at that point. If
> > you're working withing the jCIFS package you might hook into the name
> > resolution code directly. Unfortunately I just don't have the time to
> > instruct you guys better.
> > 
> > Mike
> > 
> 




More information about the jcifs mailing list