help - InetAddress.getHostName() returns the ip address

Hi,

After updating two windows XP computers witht the latest windows updates the InetAddress.getHostName() stoped returning the remote computers name and instead returns the ip address. This is how it worked :

rx = a custom DataPacket class

public InetAddress from;

System.out.println("From: "+ (rx.from.getHostName() + "/" + rx.from.getHostAddress()) + " " + receivedMessage + "\r\n");

printed - From: AUTOTEST1/192.1.3.60 test message

now it prints this - From: 192.1.3.223/192.1.3.223 test message

Is there an alternate way of getting a computers host name or is there a work around i could implement?

I need the computers host names as this is a fault logging program and without the computer name the users will not know who they are sending the mesage to as it displays ip addresses and not the computer name

Thanks,

sjs1985

[898 byte] By [sjs1985a] at [2007-11-26 17:37:56]
# 1
Have you tried NSLookup? http://www.google.com/search?q=nslookup
phawdona at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...
# 2
that wont work, this in within a company network and none of the computers have internet access.
sjs1985a at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...
# 3
works for me on company network...
phawdona at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...
# 4
oh, ok soz i was looking at the web based nslookup not the microsoft cmd command.How do you use it in your code?[edit] so no one can help me?
sjs1985a at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...
# 5
InetAddressgetHostName()getCanonicalHostName()
BIJ001a at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...
# 6

getCanonicalHostName() still returns the ip address instead of the host name, thanx 4 trying to help me.

It seems like it is not possible to receive the host name on a fully updated Windows XP computer using the InetAddress class anymore.

I will have to do it the long way and send a message containing the computer name on start up which would then be added to a list of computernames/ip addresses

sjs1985a at 2007-7-9 0:06:05 > top of Java-index,Java Essentials,Java Programming...