View Single Post
Aug 10th, 2004
0

Re: Finding an IP address using Java (was: do u know?)

The best way to obtain IP address is via the JDK's InetAddress
http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#getLocalHost()

This returns InetAddress which has many goodies you can play around with.

For example, You can do things like reverse domain name loook ups on arbitrary ipaddresses... or ip addresses from hostnames.
http://www.cs.ucl.ac.uk/staff/sjiang...ookup-test.htm

By the way Nice Runtime Trick nanosani... it doesn't work if the host is running a secure classloader though... or another OS withouth ipconfig for that matter. =\
Reputation Points: 17
Solved Threads: 1
Junior Poster
cosi is offline Offline
153 posts
since Aug 2004