Web Hosting Talk







View Full Version : Fast whois lookup in PHP?


SI-Chris
04-25-2002, 01:14 AM
I'm writing a new whois lookup in PHP. I want to look up multiple variations on a name and return the results. I'm using a simple PHP exec to call the whois on the server. The problem is, looking up 100+ names can take a few minutes.

How do services like NameBoy do it? I put in a couple of words there and get the .com, .net, .org, and .info results for dozens of variations (so hundreds of results) in a second or so. My guess is they have their own internal database of domain names, so they don't have to query a third-party server like whois.crsnic.net.

What's the fastest way to look up whether a domain is available or not from a PHP script?

jw
04-25-2002, 04:29 PM
Originally posted by Intelligent Hosting
My guess is they have their own internal database of domain names, so they don't have to query a third-party server like whois.crsnic.net.

Yep. thats correct, which is why whether a domain is registered or not is occasionally wrong.

priyadi
04-26-2002, 01:02 AM
Use DNS lookups instead of whois. Most registered domains (but not all) have NS records. DNS lookups is much faster than whois, and you don't need to hack your own caching system, your DNS server is already a cache itself.

SI-Chris
04-26-2002, 03:22 AM
priyadi... that's a great idea. What's the best way to do that, nslookup? dig? host?