Search code examples
c#asp.netscalabilitytcpclientwhois

Is it expensive to do a WHOIS lookup using TcpClient.Connect() in C#?


A customer has asked that we do a dynamic whois lookup on the homepage of their ASP.NET site, based on the IP of the user accessing the site.

The implementation would be something like what's described here:

http://www.aspheute.com/english/20000825.asp

However, I noticed that this code connects to whois.networksolutions.com. I am thinking that this may not scale very well if we are initiating a connection to this remote server on every page load.

For example, say 1000 different users hit the home page - this would cause a lot of connections to be initiated.

Any thoughts on this?


Solution

  • Yes, it can be time consuming. The amount of "expensiveness" really depends on the network connection between your server and the remote server and the response time of the remote server. You can consider caching the response if your requests are not different from each other (which is not likely to be the case for querying domain whois entered by end-users). A bigger issue is that the remote server can block you if it sees too many connections from a single IP address.