tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re[4]: Reverse DNS lookup
Date Fri, 06 Jul 2001 17:28:19 GMT
Friday, July 06, 2001, 12:15:19 PM, wrote:

>> RL>         The InetAddress...getHostName() call will use the DNS
DW> databases.
>> RL> For most computers, however, this won't return anything useful.
>> That is not true. Most of US IPs have PTR records. That includes your
>> own IP, that you had when sending your msg. By far, most servers have
>> most dynamic IPs do, most static IPs for cable/DSL do, and even most
DW> routers
>> do.

DW> The IP address I was testing is and I am able to do a reverse
DW> lookup using dig from the webserver.  It just seems to me that the
DW> InetAddress class is perhaps not using whatever it needs to do to use DNS.
DW> Does anybody know what the implementation of InetAddress is actually doing
DW> under the hood?

Well, the InetAddress methods do work correctly, Dave. Here is a quick demo:


public class IPGet {

    public static void main(String[] args) {
        try {
        } catch (Exception e) {


and the console:

C:\test>jikes -nowarn

C:\test>java IPGet

Now, for the kicker... On one run I got the same return as you
did: the IP number instead of hostname - this happens when the lookup
fails. Therefore, I would guess right now that here might be some problem
in the nameservers at lightrealm.

So, a partial dig shows:

Dig ...
Authoritative Answer
Recursive queries supported by this server
 Query for type=255 class=1 PTR (Pointer) NS (Nameserver)

  and next:

07/06/01 12:50:19 ping
Ping  failed, no such host  

That looks like a slam dunk. Lightrealm's problem, when they
periodically can't resolve within their domain. Not a Java problem.

DW> David

View raw message