[jcifs] name resolving

Alexander Buloichik Alexander_Buloichik at epam.com
Tue Sep 7 08:01:46 GMT 2004


HI !

Is it rule #1 implemented in jcifs ?

Seems to remote computer returns 2 ip addresses(it is possible if this 
computer is gateway in other network):
$ nmblookup -d 4 epmw021
added interface ip=10.6.12.33 bcast=10.6.15.255 nmask=255.255.240.0
added interface ip=192.168.74.1 bcast=192.168.74.255 nmask=255.255.255.0
Socket opened.
querying epmw021 on 10.6.15.255
nmb packet from 10.6.2.110(137) header: id=17424 opcode=Query(0) response=Yes
    header: flags: bcast=No rec_avail=No rec_des=Yes trunc=No auth=Yes
    header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0
    answers: nmb_name=EPMW021<00> rr_type=32 rr_class=1 ttl=300000
    answers   0 char `..0.6`....n   hex 60000A300E3660000A06026E
Got a positive name query response from 10.6.2.110 ( 10.48.14.54 10.6.2.110 )
10.6.2.110 epmw021<00>
10.48.14.54 epmw021<00>

my network settings is :
eth0      Link encap:Ethernet  HWaddr 00:02:B3:A3:70:5B
          inet addr:10.6.12.33  Bcast:10.6.15.255  Mask:255.255.240.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13961923 errors:74922 dropped:69695 overruns:347 
frame:74922
          TX packets:5143603 errors:103 dropped:0 overruns:0 carrier:103
          collisions:791272 txqueuelen:1000
          RX bytes:1681091583 (1.5 GiB)  TX bytes:3918308576 (3.6 GiB)

Seems to first address should be used by rule #1.

On 3 September 2004 17:35, Eric Glass wrote:
> There's a document which describes this scenario at:
>
> http://www.microsoft.com/windows2000/techinfo/reskit/en-us/cnet/cnbc_imp_wc
>ug.asp
>
>
> It states:
>
>
> 1. If one of the IP addresses in the name query response list is on
> the same logical subnet as the local computer, that address is
> selected. If more than one of the addresses meets the criteria, one is
> picked at random from those that match.
>
> 2. If one of the IP addresses in the list is on the same logical
> subnet as any binding of NetBT on the local computer, then that
> address is selected. If multiple addresses meet this criteria, one is
> picked at random.
>
> 3. If none of the IP addresses in the list is on the same subnet as
> any binding of NetBT on the local computer, then an address is
> selected at random from the list.
>
> 4. If none of the IP addresses in the list is on the same subnet as
> any binding of NetBT on the local computer, an address is selected at
> random from the list.
>
>
> (note that 3 and 4 are the same except for the word "then", so there
> are really 3 scenarios).  I don't know jCIFS uses the same logic or
> not; you could try setting some of the "jcifs.netbios.*" properties to
> see what it comes up with.
>
>
> Eric
>
>
>
> On Fri, 3 Sep 2004 16:03:14 +0300, Alexander Buloichik
>
> <alexander_buloichik at epam.com> wrote:
> > Hi, All !
> >
> > I see one interesting problem with my program which uses jcifs.
> >
> > Wins server returns two IP addresses for one name:
> >
> > alex at epmw082t1:/tmp$ nmblookup epmw025
> > querying epmw025 on 10.6.15.255
> > 10.6.2.70 epmw025<00>
> > 147.204.20.105 epmw025<00>
> >
> > When I tried to connect to epmw025 host, then jcifs tried to connect to
> > 147.204.20.105(second IP). All WIndows computers are tring to connecto to
> > 10.6.2.70 address(first IP).
> > Is it problem of jcifs ? What host should be connected in this case ?
> > How can I setup jcifs for connect to first entry ?
> >
> > WBR, Alex.


More information about the jcifs mailing list