Net_DNS: Examples: AXFR
How to perform an Zone Transfer (AXFR):
require_once("Net/DNS.php");
$res = new Net_DNS_Resolver();
$res->debug = 1;
$answer = $res->axfr("example.com");
echo "<BR><HR><BR>";
print_r($answer);
This example will query the name server and output the following:
;; axfr_start(example.com, IN) ;; query(example.com, AXFR, IN) ;; axfr_start(208.79.80.18:53) ;; sending 29 bytes ;; read_tcp: expecting 2 bytes ;; read_tcp: received 2 bytes ;; read_tcp: expecting 29 bytes ;; read_tcp: received 29 bytes ;; received 29bytes ;; HEADER SECTION ;; id = 1384 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 1 rcode = SERVFAIL ;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; ;example.com. IN AXFR ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records)
Array ( )