getCanonicalHostName on Windows
Christopher Hegarty
Christopher.Hegarty at Sun.COM
Tue Mar 4 06:35:12 PST 2008
Hi Max,
The Java methods that you are using are correct. As it is specified
"best effort" is used to determine the FQDN.
getByName will try to do forward lookup of k1.n3.local to retrieve its
address, which I assumes will succeed. Then this address is used to do a
reverse lookup to determine the FQDN of the host. What name service are
you using? Can you verify the response from the server to the reverse
lookup?
-Chris.
Max (Weijun) Wang wrote:
> Hi All
>
> I have a Windows domain called n3.local, and a server called k1 in the
> domain, and a client. When I call the line --
>
> InetAddress.getByName("k1.n3.local").getCanonicalHostName()
>
> from the client, the returned string is "k1". How can I get
> "k1.n3.local"? Is there anything wrong with my Windows configuration?
> Or, I should use another Java method?
>
> Thanks
> Max
>
More information about the net-dev
mailing list