[solved?] Re: [jcifs] NbtAddress.getByName() failing when I use a hostname.]
Michael B. Allen
mballen at erols.com
Wed Sep 26 09:22:07 EST 2001
On Tue, Sep 25, 2001 at 03:51:46PM -0700, Rob Wygand wrote:
> When I say became, I mean I changed it from pickle (NBT) to
> pickle.filefish.com (DNS). This could easily have been pickle (NBT) and
> relish.filefish.com (DNS). Both names resolve to the name box, of course.
> Not sure what you mean when you say we need to have a long talk..
> according to the JCIFS API docs, "The server component may a traditional
> NetBIOS name, a DNS name, or IP address. These name resolution
> mechanisms and their resolution order can be changed..."
>>Particularly, I switched from using the NBT name in the URL to create an
>>SmbFile to a domain name.
So is pikle a domain name (a.k.a nt workgroup)? If so, you can't put a
DNS domain on the end of that. But then about you say "Both names resolve
to the name box, of course" which suggests that pickle is the name of
a machine and not an nt domain so I'm not sure what you're doing exactly.
> I'm just saying that as long as it's a NBT or an IP it works great, but
> name resolution when it's a DNS name is flaky. Like I said, it worked
Ok, I'll look into it. I've never really used DNS heavly. Maybe some kind of
> once or twice then started throwing UnknownHostExceptions until I
> restarted my app, then worked again a few times until it started
> throwing exceptions again. As soon as I switched to an IP address
> instead of the DNS name it worked great.
> The exception it was throwing was that PICKLE.FILEFISH. was not a known
> host. I'm fairly certain that jcifs.netbios.resolveOrder had DNS first.
You know, you can take BCAST and WINS our entirely and it won't try
those. Just another option; don't know if it helps you.
> I've got a workaround that works, so I'm not in any great need, but I
> wanted to let you know that I had this, what I consider weird, problem.
> Michael B. Allen wrote:
> > 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/
> >> smb://WORKGROUP;rob:email@example.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,
> >>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
> >>>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.
More information about the jcifs