• Post Reply Bookmark Topic Watch Topic
  • New Topic

InetAddress.getLocalHost() execution time on Linux

 
Ben Zahler
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to get the ip of my machine, and noticed that InetAddress.getLocalHost() is slower than expected on my Fedora 12 machine.

Each call takes between 30 and 100 milliseconds.

However, the "hostname" command executes in 1 millisecond.

Also, on my windows system, this is a lot faster.

i have checked the /etc/hosts and also the /etc/nsswitch.conf points to the /etc/hosts file first.

Can anyone explain why the call takes so much time?

thanks a lot

Ben
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!