I want to write something to lookup my own domains, does anyone know where I can query for valid/available domains?
Basic explanation: you can make whois request to whois server. If response contains "No match for requesteddomain.com", then domain name is available. Otherwise whois server will return information about domain owner, nameservers and other data. Realization depends on skills and programming language, for instance you can use Pear Whois for performing whois queries in php. Also you can use Site Information Tool for getting information about existing domains .