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 left blank the default check will be for an MX (Mail Exchanger) record.
1 response so far ↓
1 » PHP: Checking a DNS entry Available Domains: // May 22, 2008 at 2:25 pm
[...] The rest is here: PHP: Checking a DNS entry [...]
Leave a Comment