DNS reverse lookup
Martin
marty1110 at yahoo.co.uk
Tue May 16 17:23:38 UTC 2000
Hi,
I am writing a program to examine a web servers log file. If the
web server has the option for resolving the IP address off, as
with Apache 1.3 default. Then I am faced with the problem of
resolving the IP address into a host name, thus I want to do a
reverse DNS lookup. I am writing this program in Java. So
1/ Is it possible to do a reverse DNS in Java code.
2/ I have tried the following code, and it does not work
InetAddress r;
String s;
try { // use the address you are concerned
with
r = InetAddress.getByName("192.122.98.61");
s = r.getHostName();
System.out.println(s);
}
catch (UnknownHostException e)
{
System.out.println(e);
}
3/ If it is not possible, how else can I do it?. I have tried to
use Windows NTs -
nslookup <ipaddress>.in-addr.arpa
and this doesnt work either! Has this anything to do with the
fact that I am behind a firewall??
Martin.
--Posted from EarthWeb Discussions. http://discussions.earthweb.com
More information about the bind-users
mailing list