views:

123

answers:

3

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?

+3  A: 

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.

Mehrdad Afshari
+1  A: 

I might ask the client if reverse DNS is feasible... This way you could leverage the caching abilities of your DNS server to reduce the amount of internet traffic. Unless you don't have internal DNS, in which case you would utilize the caching abilities of your ISP's DNS server.

There is a big difference between whois and DNS though, so it's up to client as to what they want.

To answer you direct question though... Maybe you could create some sort of caching for this data to reduce the number of repeat searches you have to do for a single host surfing various pages of the site?

regex
A: 

Besides caching, you may also want this lookup to be asynchronous, so any delay does not hold up serving the page.

Steven Sudit