0

In my ASP.Net Default Page i am providing the credentials, and i used the code "Dns.GetHostEntry(hostname)" to get the Machine Name. But it is taking 19+ seconds to load the next page.

var hostEntry = Dns.GetHostEntry(clientIP);
    return hostEntry.HostName;

Can any one help on this to get the machine name very fast?

Vara Prasad.M
  • 1,530
  • 9
  • 31
  • 55
  • please have a look at the similar thread, http://stackoverflow.com/questions/997046/gethostentry-is-very-slow – ijaz Dec 07 '15 at 15:57
  • tried but i am getting only Clients IP address, but not the machine name. How do get the machine name? Is there any alternative way for Dns.GetHostEntry to retrieve the machine name? – Vara Prasad.M Dec 08 '15 at 02:01

1 Answers1

0

use .ToString() when handover an IPAddress it results in a speedboost.

Example:

IPHostEntry hostinfo = Dns.GetHostEntry( data.ToString() )

Doesn't matter if the data is a Hostname (string) or an IPAddress like x.x.x.x.

If no one else has this feeling then something is wrong with the network I am connected to.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103