I'm trying to write a PHP script that tells you if a domain is available.
The most obvious way that came to mind to me was to just do a whois lookup and look at the results to work out if a domain is free or not. However, today I registered a domain, and although the details aren't appearing on a whois lookup yet, if I put the domain into my registrars search box it says it isn't available. At first I thought this was just because my registrar was checking its internal database and finding it there, however, I did the search at a completely different registrar and that said it wasn't available either.
My question therefore is is there a better way to find out if a domain (in particular .com/.net/.org and .co.uk/.org.uk) is available for registration other than just doing a WHOIS lookup (bearing in mind I want this to be done in a PHP script).