Java Network problem
Panagiotis Astithas
past at noc.ntua.gr
Mon Feb 23 03:58:40 PST 2004
mina mina wrote:
> hello ,
> i really dont know if i have to mail this to
> freebsd-java or to sun
>
> but i have jdk1.4.2 compiled on FreeBSD 5.1
> and now am working on FreeBSD 5.2-RELEASE after
> upgrade
>
> its network problem i cannot nslookup ip using java
> i have test this code on windows and its work fine
> with the same JDK
>
> InetAddress addr = InetAddress.getByName (IP);
> System.out.println ( "IP Address : " +
> addr.getHostAddress ()) ;
> System.out.println ( "hostname : " +
> addr.getHostName () );
>
> getting address (IP) of hostname is work fine
>
> but if i wana get the hostname for IP its gives me the
> same IP
>
> and my connection is Dailup
>
> thanks alot
> Mina
Works fine for me. The only case I get the IP address instead of the
host name is when there is no A entry in the DNS server's zone file.
When you use nslookup/host/dig to make the same requests do you get a
name? Do you have a correct /etc/resolv.conf? What versions of FreeBSD &
JDK do you use?
Cheers,
--
Panagiotis Astithas
Electrical & Computer Engineer, PhD
Network Management Center
National Technical University of Athens, Greece
More information about the freebsd-java
mailing list