Hi, I need help , do anybody knows how to make a php script to check domain name available for domain registration. I mean i am making a website where i want a box where people can check domain name for their domain registration and buy from same site like godaddy or namecheap.
I feel like the code posted above would not work so well because @gethostbynamel will only get the ip of the domain and the code will assume that a domain is available if it cannot find the ip. But if a domain has been registered but hasn't been pointed to a ip (or is still propogating), it will say its available but it actually will not be. A lot of domains out there are registered but not used so don't rely on the code. If you want to get an accurate information on if a domain is available, you would either have to query the whois server of the domain and check if its available. If you don't want to search for domain whois providers individually, there are a lot of different free api's available out there that can check the whois servers for you. Check this stackoverflow.com/a/8693516 So, in simple words, its not possible to accurately check if a domain is available with a couple
Check out the following free PHP scripts to check domain names. http://www.adityasubawa.com/blog/post/56/domain-checker-with-php-script.html http://www.phpf1.com/product/domain-whois-script.html http://www.mrscripts.co.uk/index.php?op=proinfo http://www.particlesoft.net/particlewhois/ http://www.cj-design.com/products/free-downloads/php-scripts/cjdomainwhois
Dear all, Thanks for all replays. But i want know how can i add a form in my website which can check a domain name is free for registration and complete registration process from same website. That mean how can i complete a domain registration from my website using any domain registrar company.
I reccomended to you a ListingDock SeoClerk CodeClerks You will find there a lot of things, including the domain name) Come and see for yourself)
I really think I run into a script like this.. try and browse it in codebasket.com . they have handy scripts that you can use as well.
Yes, I wrote one myself when making my Domain Generator. I published the code a few minutes ago on my blog. Read it here: http://helgesverre.com/blog/php-domain-availability-checking-script/
I had a look at your class there, looks interesting and I might utilize it myself. Contrary to what most people say (including your blog entry) you can still minimise your API access limit's to various NIC's by using GetHostByName or dns_get_record taking advantage of the fact that most domain get pointed to a DNS for parking revenue or genuine website hosting. A simple boolean will solve the false positive by calling on an API to NIC's or scraping from public whois DB's thus limiting remote API calls (from about 60% to 80% or more) saving usage cost, limiting resources, etc. Below an example of a domain (articlebot.com) that's regged but not pointing to a DNS and indeed returns a false positive. $domain = "articlebot.com"; #domain only, no http:// www. etc... @$data = dns_get_record($domain); if (is_array($data)) { echo $domain." is already registered!! :("; } else { /* code here for API to NIC's or scrape query results from public whois DB's to avoid false positives */ echo $domain." could be registered but not pointing to a DNS OR <b><u>maybe is available!:)</u></b>"; } PHP: In this query the first condition fails and calls the second channel where you can make the API call. From experience I'd say about 6 to 8 out of 10 queries made the domain will be pointed to a parked page or website so API usage will indeed be reduced! .
Ooooo that is actually quite a clever way to check! I might implement that into my class at some point Ty ^_^
This code is great but the only problem is that the is_array condition only checks if it's an array and even non-existent domains give an empty array (Array ()) so they get through the check. A better way would be to use this condition instead: if (empty($data)) { echo "The domain is available"; } else { echo "The domain is not available"; } PHP: