- PHP 7.0.16 (basically works, but broken)
- PHP 7.1.15 or 7.2.3 (works completely)
php caa-test.php posteo.de
or php -S localhost:8080
and http://localhost:8080/caa-test.php?input=posteo.de afterwards.
php caa-test.php posteo.de
or php -S localhost:8080
and http://localhost:8080/caa-test.php?input=posteo.de afterwards.
<?php | |
if (php_sapi_name() == 'cli') { | |
$host = $argv['1']; | |
} | |
elseif (php_sapi_name() !== 'cli') { | |
echo '<pre>'; | |
$host = $_GET['input']; | |
} | |
$records = dns_get_record($host, DNS_CAA); | |
foreach ($records as $record) { | |
echo $record['host']; | |
echo " "; | |
echo $record['type']; | |
echo " "; | |
echo $record['flags']; | |
echo " "; | |
echo $record['tag']; | |
echo " "; | |
echo $record['value']; | |
echo "\n"; | |
} | |
//var_dump($records); // Uncomment for complete output as array. Use to debug. | |
?> |