It is often useful to check that a given domain name or host is valid, this can be achieved using the checkdnserr() command, as in the following example:
$hostname = “www.domain.com.”;
$dnstype = “MX”;
$bValid = checkdnserr($hostname,$dnstype);
If using a DNS name then ensure the domain ends with the root domain qualifier (the “.”)
If the $dnstype is omitted or [...]
PHP: Checking a DNS entry
May 22nd, 2008 · 1 Comment
Tags: Tip