How To Check If A Domain Name Is Registered
4 Answers four
"Registered" doesn't mean "assigned an IP accost". To know whether a domain name is registered, you'll need to do a whois query.
For Python, there's pywhois, just from its web site it seems somewhat young. Also see this SO question.
For PHP, there'south... surprise... phpwhois.
answered Nov eight, 2009 at xix:48
ThomasThomas
162k 43 gilt badges 331 silvery badges 442 statuary badges
ane
Mike Nott has created a simple PHP course that allows you to query the who.is data for any domain you wish.
Once you phone call
$whois = getwhois($sld, $tld);
yous so only need to cheque the contents of $whois
to determine whether the domain is currently registered.
answered November eight, 2009 at 19:47
ConroyPConroyP
39.9k 16 gold badges 77 silver badges 86 bronze badges
apply the net_whois package from pear. for multiple results, which may occur when server names are also reported forth with domain names do something like to:
require_once ¨Cyberspace/Whois.php¨; $whois = new Net_Whois; $whois->authorative = true; $data = $whois->query(¨example.com¨);
answered November 8, 2009 at 23:49
kguestkguest
3,759 3 gilt badges 29 silver badges 31 bronze badges
To check if a domain proper name is registered you need two informations:
- The whois server for the respective top level domain (or second level domain)
- A matching pattern for the response of that whois server
Those informations practise change oft. This Whois Server list tries to compile the needed informations for more than 500 top level domains. The listing also offers an API service to check if a domain is bachelor. The PHP client for that API would exist whois-api-php:
$whoisApi = new whoisServerList\WhoisApi("apiKey"); echo $whoisApi->isAvailable("case.internet") ? "available" : "registered";
answered Mar half dozen, 2016 at 20:32
Markus MalkuschMarkus Malkusch
7,510 2 gilded badges 37 silver badges 63 statuary badges
Not the answer you're looking for? Browse other questions tagged php python dns names or enquire your own question.
How To Check If A Domain Name Is Registered,
Source: https://stackoverflow.com/questions/1697663/checking-if-a-domain-name-is-registered
Posted by: parkthynand69.blogspot.com
Yeah, the whole registered non meaning assigned an ip accost is why it failed as a solution for me.
Nov 8, 2009 at 20:35