Hi, I need to resolve an host address to ip. My android device can ping to the hostname only to resolve the host to IP . But when I use InetAddress.getByname, it throws an exception.
An excerpt of hyper terminal trace is below. Please help me resolve this issue by letteing me know which api i must use as ping is only having DNS resolution but not successful packet transmission. Trace: # ping -c 2 www.google.com PING www.l.google.com (209.85.132.104) 56(84) bytes of data. ^C ^C --- www.l.google.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms # # # # # ping -c 2 www.yahoo.com PING any-fp.wa1.b.yahoo.com (67.195.160.76) 56(84) bytes of data. ^C --- any-fp.wa1.b.yahoo.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms # ping -c 2 www.starwave.com PING starwave.com (199.181.132.250) 56(84) bytes of data. --- starwave.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms # # The trace of exception by InetAddress.getByname: ------------------------------------------------------ W/Server( 1122): Connection error: W/Server( 1122): java.net.UnknownHostException: starwave.com W/Server( 1122): at java.net.InetAddress.lookupHostByName(InetAddress.java:504) W/ Server( 1122): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:280) W/ Server( 1122): at java.net.InetAddress.getByName(InetAddress.java:310) W/Server( 1122): at android..config.Config.getSLPHost(Config.java:169) W/Server( 1122): at com.android.server.Server.run(Server.java:211) W/ Server( 1122): at java.lang.Thread.run(Thread.java:1096) Thanks in advance for your time Regards, GSA -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en