[jcifs] Question about configuring resolve order
Christopher R.Hertel
crh at ubiqx.mn.org
Thu Mar 14 10:56:12 EST 2002
On Wed, Mar 13, 2002 at 06:23:51PM -0500, mike wrote:
>
> Hello,
>
> I'm attempting to use NbtAddress.getByName() to resolve IP
> addresses to their corresponding NetBIOS name. Provided that the
> IP address resides on the same subnet this appears to
> work. However when the box resides on a different
> subnet I get an UnknownHostException.
>
> The 'jcifs.netbios.wins' and 'jcifs.resolveOrder' properties
> appear to be set correctly.
have an IP address and want to get a NetBIOS name from that address, you
don't actually use WINS (NBNS) at all. The query is sent to the IP
address, and you hope to get a list of NetBIOS names back from the remote
node.
> I turned on debugging and here's what I'm seeing:
>
> ---------------------------------------------------------------------------
> ...
> jcifs.resolveOrder=WINS,BCAST
> jcifs.properties=./jcifs.properties
> jcifs.smb.client.password=
> jcifs.smb.client.domain=
> jcifs.smb.client.laddr=
> jcifs.smb.client.username=guest
> jcifs.util.log=ALL
> jcifs.netbios.retryTimeout=2000
> jcifs.netbios.cachePolicy=30
> jcifs.netbios.baddr=255.255.255.255
> jcifs.netbios.retryCount=2
> jcifs.netbios.wins=192.168.0.38
> jcifs.netbios..hostname=OpenNMS_DP
> path.separator=:
>
> Mar 13 18:05:38.304 - name service address cache
> 0.0.0.0<00> 0.0.0.0<00>/0.0.0.0
> JCIFS0_198_CC<20> JCIFS0_198_CC<20>/192.168.0.198
>
> Mar 13 18:05:38.331 - nbt name service packet sent
> NodeStatusRequest[nameTrnId=1,isResponse=false,opCode=QUERY,isAuthAnswer=false,isTruncated=false,isRecurAvailable=false,isRecurDesired=true,isBroadcast=true,resultCode=0,questionCount=1,answerCount=0,authorityCount=0,additionalCount=0,questionName=*<00>,questionType=0x0021,questionClass=IN,recordName=null,recordType=0x0000,recordClass=0x0000,ttl=0,rDataLength=0]
> Mar 13 18:05:38.332 - datagram packet sent to: 192.168.3.2
> 00000: 00 01 01 10 00 01 00 00 00 00 00 00 20 43 4B 41 |............ CKA|
> 00010: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 |AAAAAAAAAAAAAAAA|
> 00020: 41 41 41 41 41 41 41 41 41 41 41 41 41 00 00 21 |AAAAAAAAAAAAA..!|
> 00030: 00 01 |.. |
The query is being sent unicast to node 192.168.3.2, using the wildcard
name. That's good, but then the remote node gives no reply... I saw
three more attempts with no result in your trace.
The remote node is not running NBT services *or* it is a Windows/95 box
(some versions of W/95 have this bug, see...).
> I don't understand why all the requests are being sent directly to
> the 192.168.3.2 address. My understanding is that based on my
> properties settings I should see requests first being sent to the
> WINS server and if that fails requests would next be broadcasted
> on the local subnet. What am I missing?
WINS does not support reverse lookups. The only way to do an
IP-to-NetBIOS name lookup is to send the query to the IP address that you
have. *IF* the remote node is running the NetBIOS name service and *if*
the remote node is not a Win/95 OSR1 machine it will reply with a list of
names that it owns.
See: http://www.ubiqx.org/cifs/NetBIOS.html
Chris -)-----
--
Samba Team -- http://www.samba.org/ -)----- Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/ -)----- ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/ -)----- crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/ -)----- crh at ubiqx.org
More information about the jcifs
mailing list