Stipe
Stipe

Reputation: 57

Is checkdnsrr() function good enough to establish domain (in)availability?

I want to create simple script to check domain availability. Can anybody tell me is this function enough to check domain availability before user can register:

<?php
$recordexists = checkdnsrr("www.google.com", "ANY");

if ($recordexists)  
    echo "The domain name has been taken. Sorry!";
else 
    echo "The domain name is available!";

?>

or should I go with some other whois script like http://www.mrscripts.co.uk/index.php?op=lite

Upvotes: 0

Views: 1001

Answers (1)

Rob
Rob

Reputation: 48379

A domain doesn't have to have any associated DNS records to be "taken" in the sense that we register and manage domains. A domain could be reserved with the registration authority pending the completion of a registration, or it might not have been added to the designated name servers just afterwards.

If you're looking for something that's only intended to be indicative, then this approach is probably good enough. It just depends on what "good enough" means for you.

Upvotes: 2

Related Questions