[jcifs] "A duplicate name exists on network" when a host has multiple names

Michael B Allen mba2000 at ioplex.com
Mon Oct 17 17:36:41 GMT 2005


On Mon, 17 Oct 2005 01:32:08 -0700
Praveen Tammana <praveen.public at gmail.com> wrote:

> Hi,
> 
> I am working with 1.2.1 and I am getting errors when working with a host
> that has multiple names. (eg: deathstar = zpac23 =
> 172.25.181.23<http://172.25.181.23>).
> For example, when I run the ListFiles example:
> 
> java ListFiles smb://deathstar/ ------- works
> java ListFiles smb://zpac23/ ------- does not
> java ListFiles smb://172.25.181.23/ ------- works

Where exactly does it fail? What's the exception?

> 
> Dumping the contents of InetAddress for this host reveal that
> getHostName() = "deathstar" and
> getCanonicalHostName() = "zpac23"
> 
> I am afraid I don't know exactly what kind of machine this is at this time
> (some Windows) but my client is running a linux 2.4.26 derivative and it is
> talking to the server on port 445 - naked tcp.
> 
> Any solution? Has anyone seen this before?
> 
> Thanks
> -Praveen
> 
> P.S. I am using dnsjava <http://www.xbill.org/dnsjava/> for DNS name
> resolution and the InetAddress retuned by it always has getHostName() =
> getCanonicalHostName() = "zpac23" regardless of what name I use with
> getByName(), so it never works in there. It seems to be an error on
> dnsjava's part because, as per documentation of InetAddress.getHostName(),
> "If this InetAddress was created with a host name, this host name will be
> remembered and returned;...."
> 


More information about the jcifs mailing list