Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,950 questions

51,892 answers

573 users

How to check if a domain is available or not in PHP

4 Answers

0 votes
if (checkdnsrr('google.com.', 'ANY')) 
    echo "DNS Record found";
else 
    echo "No DNS Record found";
    
/*
run:

DNS Record found

*/

 



answered Oct 4, 2016 by avibootz
edited Jul 7, 2018 by avibootz
0 votes
if (checkdnsrr('google-koogle.com.', 'ANY')) 
    echo "DNS Record found";
else 
    echo "No DNS Record found";
    
/*
run:

No DNS Record found

*/

 



answered Oct 4, 2016 by avibootz
edited Jul 7, 2018 by avibootz
0 votes
$domain = "seek4info.com"; 
if (gethostbyname($domain) != $domain) 
    echo "DNS Record found";
else 
    echo "NO DNS Record found";
    
/*
run:

DNS Record found

*/

 



answered Oct 4, 2016 by avibootz
0 votes
$domain = "seek4info-peek4info.com"; 
if (gethostbyname($domain) != $domain) 
    echo "DNS Record found";
else 
    echo "No DNS Record found";
    
/*
run:

No DNS Record found

*/

 



answered Oct 4, 2016 by avibootz
edited Jul 7, 2018 by avibootz

Related questions

1 answer 194 views
1 answer 175 views
2 answers 81 views
1 answer 97 views
1 answer 143 views
1 answer 548 views
1 answer 171 views
...