Example 1 — Alias Check for A Records
Call dns_check_record() the same way you would call checkdnsrr(). Sample output is fixed.
<?php
if (dns_check_record("example.com", "A")) {
echo "A record found", PHP_EOL;
} else {
echo "No A record (or lookup failed)", PHP_EOL;
} How It Works
- dns_check_record() looks for A records for example. com.
- true means at least one A record exists.
- false would mean none found or a lookup error.
- The printed text is a typical tutorial sample.

