I'm struggling to get enableLookups to work on a new Ubuntu 8.10 tomcat
6.0.18 install.  Calls to httpServletRequest.getHostName() always return the
IP, instead of the host name.  I set the access log to resolve hosts and it
also shows the ip.  

Tomcat 6.0.18 and the same webapp perform the reverse lookups fine on a
WindowsXP machine.  It doesn't appear to be a permissions problem, as I've
temporarily granted AllPermission to my webapp.  I've traced it down to
java.net.InetAddress.getAddressFromNameService(String host, InetAddress
reqAddr) and the subsequent call to
sun.net.spi.nameservice.NameService.lookupAllHostAddr(host), which returns
null. 

Inside getAddressFromNameService, the host is the valid host that I wish
would be returned.  Since the lookupAllHostAddr(host) call fails,
getAddressFromNameService then throws an UnknownHostException.

I also tried setting -Dsun.net.spi.nameservice.provider.1=dns,sun but that
didn't make a difference.

Could it be a dns config issue on my ubuntu box (hosted by slicehost)? 
Using the host command and an IP in question returns the host name that I
want to get back from httpServletRequest.getRemoteHost().  Any tips for me? 
I'm a linux noob.

Thanks,
Peter
-- 
View this message in context: 
http://www.nabble.com/enableLookups%3Dtrue%2C-getRemoteHost-returns-ip-tp21696774p21696774.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to