dale.mcduffie@Eng 1998-09-30
----------------------------
A customer reports that this bug is in fact not fixed in 1.2beta4: they are not
using NIS. I am unable to find a non-NIS machine, but believe that the customer
is correct. Here is the call with the test case:
Bug #4073539 describes how java.net.InetAddress.getLocalHost()
returns the first entry in /etc/hosts instead of the correct
address. That bug page is labeled "closed, fixed in 1.2beta4,
1998-04-13". However, the bug is still present in 1.2beta4
on my Solaris 2.6 system, as seen below.
[baskerville] uname -a
SunOS baskerville.CS.Arizona.EDU 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-1
[baskerville] java -version
java version "1.2beta4"
Classic VM (build JDK-1.2beta4-K, green threads, sunwjit)
[baskerville] java -fullversion
java full version "JDK-1.2beta4-K"
[baskerville]
[baskerville] cat t.java
import java.net.*;
class t {
public static void main (String args[]) {
try {
System.out.println(InetAddress.getLocalHost().getHostName());
} catch (Exception e) {
e.printStackTrace();
}
}
}
[baskerville]
[baskerville] javac t.java
[baskerville] java t
localhost
[baskerville]
- duplicates
-
JDK-4056768 InetAddress.getLocalHost() always returns "localhost"
- Closed
-
JDK-4060691 java.net.InetAddress.getLocalHost() returns 127.0.0.1
- Closed
-
JDK-4065543 getByName returns a different result from the one for getLocalHost
- Closed
-
JDK-4066222 pass wrong parameter to gethostbyaddr_r() in java_net_InetAddressImpl_getLocalHo
- Closed
-
JDK-4073306 iaddr.getLocalHost/iaddr.getHostName() does not understand /etc/hosts correctly
- Closed
-
JDK-4088617 InetAddress.getLocalHost() not returning host-info
- Closed
-
JDK-4163652 InetAddress.getLocalHost returns first line in /etc/hosts
- Closed