• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

sloowwwww Reverse DNS lookup

Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic