PHP code example of redbox / dns
1. Go to this page and download the library: Download redbox/dns library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
redbox / dns example snippets
$resolver = new \Redbox\DNS\Resolver();
$resolver->resolve('google.com', DNS_MX);
foreach($resolver as $record) {
if ($record['type'] == 'MX')
echo $record['type'] . ' ' . $record['pri'] . ' '. $record['target']."\n";
};
/* retreive all CNAME records */
$resolver->resolve('google.com', DNS_CNAME);