How to use dns_check_record() to check if name server exists for a host name in PHP

2 Answers

0 votes
$host = "yahoo.com";

if (dns_check_record($host, "NS")) 
    echo "Name server exists";

else 
    echo "No name server was found";

/*
run:

Name server exists

*/

 



answered Oct 4, 2016 by avibootz
0 votes
$host = "2001aspaceodysseymovie.com";

if (dns_check_record($host, "NS")) 
    echo "Name server exists";

else 
    echo "No name server was found";

/*
run:

No name server was found

*/

 



answered Oct 4, 2016 by avibootz
...