Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 10072 invoked by uid 500); 6 Jul 2001 03:56:34 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 10064 invoked from network); 6 Jul 2001 03:56:32 -0000 Received: from athena.intergrafix.net (206.245.154.69) by h31.sny.collab.net with SMTP; 6 Jul 2001 03:56:32 -0000 Received: from usr134.wb.intergrafix.net (usr134.wb.intergrafix.net [206.245.180.134]) by athena.intergrafix.net (Postfix) with ESMTP id 778384AE8D; Thu, 5 Jul 2001 23:56:35 -0400 (EDT) Date: Thu, 5 Jul 2001 23:56:42 -0400 From: wire@mailops.com X-Mailer: The Bat! (v1.47 Halloween Edition) UNREG / CD5BF9353B3B7091 X-Priority: 3 (Normal) Message-ID: <218081358.20010705235642@mailops.com> To: tomcat-user@jakarta.apache.org, "David Wall" Subject: Re: Remove DNS lookup In-reply-To: <00ad01c105cc$c3aac320$5a2b7ad8@expertrade.com> References: <00ad01c105cc$c3aac320$5a2b7ad8@expertrade.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Thursday, July 05, 2001, 11:35:55 PM, dwall@myEastside.com wrote: DW> Is there a class that can do a reverse DNS lookup, giving me the hostname DW> that matches a given IP address? I'm able to retrieve the IP address of an DW> HTTP request just fine using request.getRemoteAddr() (and getRemoteHost() DW> returns the same IP address dotted numbers), but the java.net package DW> doesn't seem to have DW> anything that returns a name based on an IP address, unless I'm just DW> misreading InetAddress... InetAddress.getByName().getHostName() will do what you want, if the info is available. getRemoteHost() doesn't work if the webserver is configured not to spend time doing the lookup for every request, or if no rDNS record exists for that IP. DW> David