Current Location: Home> Function Categories> checkdnsrr

checkdnsrr

Check DNS records corresponding to the given Internet hostname or IP address
Name:checkdnsrr
Category:Network
Programming Language:php
One-line Description:Check DNS records of the type corresponding to the host.

Definition and usage

checkdnsrr() function checks DNS records of the type corresponding to the host.

We can use the checkdnsrr() function to check our DNS record to verify that the domain name exists.

Example

Check DNS records:

 <?php
$domain = "gitbox.net" ;
if ( checkdnsrr ( $domain , "MX" ) ) {
  echo "Passed" ;
} else {
  echo "Failed" ;
}
?>

grammar

 checkdnsrr ( host , type )

Parameter value

parameter describe
host Required. Specifies the IP address or host name to check.
type

Optional. Specify the type. It can be one of the following:

  • A
  • MX (default)
  • NS
  • SOA
  • PTR
  • CNAME
  • AAAA
  • A6
  • SRV
  • NAPTR
  • txt
  • ANY
Similar Functions
Popular Articles