Not only easy ones like .com or .net, but also, .co.uk, .fr, .gov.rw ... ?
Should I really make a huge mapping "tld to relevant whois server", or is there an easier way ?
Not only easy ones like .com or .net, but also, .co.uk, .fr, .gov.rw ... ?
Should I really make a huge mapping "tld to relevant whois server", or is there an easier way ?
You may have to try different services:
This one seems to work for a lot more than the standard Whois: http://whois.domaintools.com/
Works for .co.uk and .fr as well as the standard ones
php
$URL = "http://www.dotnetindex.com/articles/5261-Article--AJAX-Tips-and-Tricks.asp";
$PARSED_URL = parse_url($URL);
$DOMAIN = $PARSED_URL['host'];
$ip = gethostbyname($DOMAIN);
if($ip===$DOMAIN)
{ echo "Url does not exist"; }
else { echo "Url exists"; }
Do you want to know if the domain is registered, or if it's actually present in the DNS ?
If the former, then whois based approaches are the only viable way, and even then you'll run into massive issues parsing the highly varied output from the various TLDs whois servers.
If the latter, a simple DNS lookup will suffice.