I got this strange error.
On AIX, if I can get to my server from the command line (using ping / telnet)
But if I try to use java, I have a UnkownHostException
This is because Java cannot somehow "use" DNS, but I donβt know why. If I use an IP address, it works fine.
This is my test program.
import java.net.*; public class Test { public static void main( String [] args ) throws Exception { String host = args[0]; int port = Integer.parseInt( args[1] ); System.out.println("Connecting to: " + host + " at port: " + port ); Socket socket = new Socket( host, port ); System.out.println("Connected!"); socket.close(); System.out.println("Closed!"); } }
Does anyone know of some configuration on AIX that prevents programs (like java) from accessing DNS information?
I (well, sysadm) added my address to / etc / hosts, but it doesn't work either.
Thanks in advance
Java version:
Java(TM) 2 Runtime Environment, Standard Edition (build pap32dev-20080315 (SR7)) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20080315 (JIT enabled)
unknown
source share