SL8R.co.uk - Code Zone

Code, Code and Code

SL8R.co.uk - Code Zone header image 4

PHP: Checking a DNS entry

May 22nd, 2008 · 1 Comment

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 [...]

[Read more →]

Tags: Tip