PHP code example of jdwx / dns-query

1. Go to this page and download the library: Download jdwx/dns-query 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/ */

    

jdwx / dns-query example snippets


$out = Resolver::dns_get_record( 'google.com', DNS_MX );
var_dump( $out );

$out = Resolver::dns_get_record( 'google.com', DNS_MX, '1.1.1.1' );
var_dump( $out );

$rsv = new Resolver();
$out = $rsv->compatQuery( 'google.com', DNS_MX );
var_dump( $out );

$rsv = new Resolver();
$out = $rsv->query( 'google.com', 'MX' );
var_dump( $out );