This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes sloowwwww  Reverse DNS lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "sloowwwww  Reverse DNS lookup" Watch "sloowwwww  Reverse DNS lookup" New topic
Author

sloowwwww Reverse DNS lookup

Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 819

Here is my simple code:


I understand that there is no guarantee that this will return a proper host name. For some ip addresses, this takes a ridiculously long time to return, often with just the same ip address I put in. Other ip addresses are faster. Meanwhile, netstat from the command line returns all IP addresses instantly.

So I have three questions:
1) InetAddress API says that it uses a "System Configured lookup setting" to resolve the ip address to a host name. what settting would this be?
2) Why do some ip addresses take longer than others?
3) How does netstat get this same information so much faster?

I am loking through the SIGAR code for their netstat implementation and it just uses something similar to what I put above.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: sloowwwww Reverse DNS lookup
 
Similar Threads
Why does RMI naming lookup work on the local host when I give it a garbage name?
inetaddress dns?
Using ip address in place of localhost
is RMI this slow????
RMI Binding on localhost