UNIX / Solaris 8 Software Dictionary 3S Info LegoRacers Other Crap 

       yPass Home > yPass Software > PHP Modules > PHP Resolver Library > Examples > Zone Transfer
Examples
MX Lookup
PTR Lookup
DNS Update
Zone Transfer
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) ;; HEADER SECTION ;; id = 39586 ;; qr = 0 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 0 rcode = NOERROR ;; 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) ;; send_tcp(209.170.128.70:53) (src port = ) ;; sending 29 bytes ;; received 29 bytes ;; HEADER SECTION ;; id = 39586 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 1 rcode = NOTAUTH ;; 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)


net_dns_packet Object ( [debug] => 1 [header] => net_dns_header Object ( [id] => 39586 [qr] => 1 [opcode] => QUERY [aa] => 0 [tc] => 0 [rd] => 1 [ra] => 1 [rcode] => NOTAUTH [qdcount] => 1 [ancount] => 0 [nscount] => 0 [arcount] => 0 ) [compnames] => Array ( ) [answerfrom] => 209.170.128.70 [answersize] => 29 [question] => Array ( [0] => net_dns_question Object ( [qname] => example.com [qtype] => AXFR [qclass] => IN ) ) [answer] => Array ( ) [authority] => Array ( ) [additional] => Array ( ) )